mumuki-laboratory 6.1.5 → 6.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/app/assets/javascripts/application.js +1 -0
- data/app/assets/javascripts/application/codemirror-builder.js +11 -1
- data/app/assets/javascripts/application/codemirror.js +0 -1
- data/app/assets/javascripts/application/discussions.js +15 -2
- data/app/assets/javascripts/application/free-form.js +1 -1
- data/app/assets/javascripts/application/kids.js +3 -3
- data/app/assets/javascripts/application/load-error-svg.js +1 -1
- data/app/controllers/invitations_controller.rb +1 -1
- data/app/helpers/application_helper.rb +0 -22
- data/app/helpers/assets_helper.rb +12 -0
- data/app/helpers/assignment_result_helper.rb +1 -1
- data/app/helpers/assistance_box_helper.rb +9 -0
- data/app/helpers/editor_helper.rb +13 -0
- data/app/helpers/locale_helper.rb +11 -0
- data/app/helpers/menu_bar_helper.rb +13 -0
- data/app/helpers/multiple_file_editor_helper.rb +5 -0
- data/app/helpers/open_graph_helper.rb +12 -0
- data/app/helpers/page_title_helper.rb +11 -0
- data/app/views/exercise_solutions/_kids_results.html.erb +1 -1
- data/app/views/exercises/_read_only.html.erb +3 -1
- data/app/views/invitations/show.html.erb +1 -1
- data/app/views/layouts/_kids.html.erb +1 -1
- data/app/views/layouts/_main.html.erb +5 -20
- data/app/views/layouts/application.html.erb +2 -7
- data/app/views/layouts/exercise_inputs/editors/_multiple_files.html.erb +11 -12
- data/app/views/layouts/exercise_inputs/layouts/_input_kids.html.erb +1 -1
- data/app/views/layouts/exercise_inputs/read_only_editors/_code.html.erb +1 -1
- data/app/views/layouts/exercise_inputs/read_only_editors/_free_form.html.erb +1 -1
- data/app/views/layouts/exercise_inputs/read_only_editors/_multiple_files.html.erb +29 -0
- data/app/views/layouts/mailer.html.erb +1 -1
- data/app/views/layouts/modals/_kids_context.html.erb +1 -1
- data/config/initializers/form_builder.rb +4 -5
- data/lib/events.rb +1 -4
- data/lib/mumuki/laboratory/locales/en.yml +0 -1
- data/lib/mumuki/laboratory/locales/es.yml +0 -1
- data/lib/mumuki/laboratory/locales/pt.yml +0 -1
- data/lib/mumuki/laboratory/version.rb +1 -1
- data/public/character/kids/{yellow_context.svg → kibi_context.svg} +2 -2
- data/public/{amarillo.svg → kibi.svg} +2 -2
- data/public/{anim_amarillo.svg → kibi_animated.svg} +2 -2
- data/public/{amarillo_fracaso.svg → kibi_failure.svg} +2 -2
- data/public/{amarillo_exito.svg → kibi_success.svg} +2 -2
- data/public/{amarillo_exito_bailarin.svg → kibi_success_dancing.svg} +2 -2
- data/spec/capybara_helper.rb +4 -4
- data/spec/helpers/application_helper_spec.rb +0 -16
- data/spec/helpers/page_title_helper_spec.rb +19 -0
- data/spec/spec_helper.rb +2 -1
- data/vendor/assets/javascripts/codemirror-autorefresh.js +46 -0
- metadata +76 -163
- data/spec/factories/api_client_factory.rb +0 -18
- data/spec/factories/assignments_factory.rb +0 -7
- data/spec/factories/book_factory.rb +0 -7
- data/spec/factories/chapter_factory.rb +0 -16
- data/spec/factories/complement_factory.rb +0 -6
- data/spec/factories/course_factory.rb +0 -9
- data/spec/factories/discussion_factory.rb +0 -8
- data/spec/factories/exam_factory.rb +0 -9
- data/spec/factories/exercise_factory.rb +0 -73
- data/spec/factories/guide_factory.rb +0 -30
- data/spec/factories/invitation_factory.rb +0 -7
- data/spec/factories/lesson_factory.rb +0 -7
- data/spec/factories/login_settings_factory.rb +0 -5
- data/spec/factories/message_factory.rb +0 -11
- data/spec/factories/organization_factory.rb +0 -26
- data/spec/factories/topic_factory.rb +0 -9
- data/spec/factories/user_factory.rb +0 -8
- data/spec/models/api_client_spec.rb +0 -6
- data/spec/models/assignment_spec.rb +0 -191
- data/spec/models/book_import_spec.rb +0 -49
- data/spec/models/book_spec.rb +0 -114
- data/spec/models/course_spec.rb +0 -22
- data/spec/models/discussion_spec.rb +0 -174
- data/spec/models/event_generation_spec.rb +0 -189
- data/spec/models/event_publishing_spec.rb +0 -36
- data/spec/models/exam_spec.rb +0 -151
- data/spec/models/exercise_spec.rb +0 -494
- data/spec/models/guide_import_spec.rb +0 -300
- data/spec/models/guide_spec.rb +0 -83
- data/spec/models/interactive_spec.rb +0 -143
- data/spec/models/language_spec.rb +0 -56
- data/spec/models/lesson_spec.rb +0 -90
- data/spec/models/message_spec.rb +0 -87
- data/spec/models/navigation_spec.rb +0 -70
- data/spec/models/organization_spec.rb +0 -124
- data/spec/models/playground_spec.rb +0 -23
- data/spec/models/problem_spec.rb +0 -80
- data/spec/models/query_spec.rb +0 -21
- data/spec/models/question_spec.rb +0 -37
- data/spec/models/reading_spec.rb +0 -10
- data/spec/models/solution_spec.rb +0 -66
- data/spec/models/stats_spec.rb +0 -15
- data/spec/models/string_spec.rb +0 -9
- data/spec/models/topic_import_spec.rb +0 -42
- data/spec/models/usage_spec.rb +0 -77
- data/spec/models/user_changed_spec.rb +0 -35
- data/spec/models/user_spec.rb +0 -276
- data/spec/models/with_expectations_spec.rb +0 -56
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 909a92d416ba2c5299aab4c4479952dbbe177b12fae72c72f9ea17ff21dadcd6
|
4
|
+
data.tar.gz: b385470e51e9e2113aa06c28b3f2c3f1aac302eec558a53ce5444f26621e8c95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7aceb26a541f78d303313bf5947aaaffda98f9357d17db6d406627a5c54e7b93563b92c12e01e70d1ce0845209ced3162c67e89dbba895db795da3628760d492
|
7
|
+
data.tar.gz: 830887ef20609c824490c7e4c2b15470c03cbc5a491aa620afbfc5fb3c9e6e205087adcef6071d11db7aa58da42253d708a0263bc84e13574bc09c358fafdf41
|
@@ -25,7 +25,8 @@ var mumuki = mumuki || {};
|
|
25
25
|
lineWiseCopyCut: true,
|
26
26
|
autoCloseBrackets: true,
|
27
27
|
showCursorWhenSelecting: true,
|
28
|
-
lineWrapping: true
|
28
|
+
lineWrapping: true,
|
29
|
+
autoRefresh: true
|
29
30
|
};
|
30
31
|
|
31
32
|
CodeMirrorBuilder.prototype = {
|
@@ -61,6 +62,15 @@ var mumuki = mumuki || {};
|
|
61
62
|
|
62
63
|
return this;
|
63
64
|
},
|
65
|
+
setupReadOnlyEditor: function () {
|
66
|
+
this.editor = this.createEditor({
|
67
|
+
readOnly: true,
|
68
|
+
cursorBlinkRate: -1, //Hides the cursor
|
69
|
+
lineNumbers: true
|
70
|
+
});
|
71
|
+
|
72
|
+
return this;
|
73
|
+
},
|
64
74
|
setupLanguage: function (language) {
|
65
75
|
var highlightMode = language || this.$textarea.data('editor-language');
|
66
76
|
if (highlightMode === 'dynamic') {
|
@@ -19,14 +19,27 @@ mumuki.load(function () {
|
|
19
19
|
var textarea = $textarea[0];
|
20
20
|
if(!textarea) return;
|
21
21
|
|
22
|
-
new mumuki.editor.CodeMirrorBuilder(textarea)
|
22
|
+
return new mumuki.editor.CodeMirrorBuilder(textarea)
|
23
23
|
.setupSimpleEditor()
|
24
24
|
.setupMinLines($textarea.data('lines'))
|
25
25
|
.build();
|
26
26
|
}
|
27
27
|
|
28
|
-
|
28
|
+
function createReadOnlyEditors() {
|
29
|
+
return $(".read-only-editor").map(function (index, textarea) {
|
30
|
+
var $textarea = $("#solution_content");
|
29
31
|
|
32
|
+
return new mumuki.editor.CodeMirrorBuilder(textarea)
|
33
|
+
.setupReadOnlyEditor()
|
34
|
+
.setupMinLines($textarea.data('lines'))
|
35
|
+
.setupLanguage()
|
36
|
+
.build();
|
37
|
+
});
|
38
|
+
}
|
39
|
+
|
40
|
+
createReadOnlyEditors();
|
41
|
+
createNewMessageEditor();
|
42
|
+
|
30
43
|
var Forum = {
|
31
44
|
toggleButton: function (spans) {
|
32
45
|
spans.toggleClass('hidden');
|
@@ -20,7 +20,7 @@ mumuki.load(() => {
|
|
20
20
|
if (!json) return;
|
21
21
|
|
22
22
|
let values = JSON.parse(json);
|
23
|
-
$('.mu-read-only-
|
23
|
+
$('.mu-read-only-editor .mu-free-form-input').prop('disabled', true);
|
24
24
|
|
25
25
|
$('.mu-free-form-input').each(function () {
|
26
26
|
loadInput(values, $(this));
|
@@ -160,7 +160,7 @@ mumuki.load(function () {
|
|
160
160
|
mumuki.kids._hideMessageOnCharacterBubble();
|
161
161
|
var $bubble = mumuki.kids.getCharacterBubble();
|
162
162
|
Object.keys(mumuki.kids.resultAction).forEach($bubble.removeClass.bind($bubble));
|
163
|
-
mumuki.kids.getCharaterImage().attr('src', '/
|
163
|
+
mumuki.kids.getCharaterImage().attr('src', '/kibi_animated.svg');
|
164
164
|
},
|
165
165
|
|
166
166
|
_hideMessageOnCharacterBubble: function () {
|
@@ -186,7 +186,7 @@ mumuki.load(function () {
|
|
186
186
|
|
187
187
|
_showOnSuccessPopup: function (data) {
|
188
188
|
mumuki.kids.getSubmissionResult().html(data.html);
|
189
|
-
mumuki.kids.getCharaterImage().attr('src', '/
|
189
|
+
mumuki.kids.getCharaterImage().attr('src', '/kibi_success.svg');
|
190
190
|
mumuki.kids._showMessageOnCharacterBubble(data);
|
191
191
|
setTimeout(function () {
|
192
192
|
var results_kids_modal = mumuki.kids.getResultsModal();
|
@@ -209,7 +209,7 @@ mumuki.load(function () {
|
|
209
209
|
},
|
210
210
|
|
211
211
|
_showOnCharacterBubble: function (data) {
|
212
|
-
mumuki.kids.getCharaterImage().attr('src', '/
|
212
|
+
mumuki.kids.getCharaterImage().attr('src', '/kibi_failure.svg');
|
213
213
|
mumuki.kids._showMessageOnCharacterBubble(data);
|
214
214
|
},
|
215
215
|
|
@@ -8,7 +8,7 @@ mumuki.load(function () {
|
|
8
8
|
addImage(mumuki.errors, 'error_' + svgErrorSuffix, '/');
|
9
9
|
});
|
10
10
|
|
11
|
-
addImage(mumuki.characters, '
|
11
|
+
addImage(mumuki.characters, 'kibi_context', '/character/kids/');
|
12
12
|
addImage(mumuki.characters, 'magnifying_glass_apparition', '/');
|
13
13
|
addImage(mumuki.characters, 'magnifying_glass_loop', '/');
|
14
14
|
|
@@ -1,20 +1,6 @@
|
|
1
1
|
module ApplicationHelper
|
2
2
|
include WithStudentPathNavigation
|
3
3
|
|
4
|
-
def contact_email
|
5
|
-
Organization.current.contact_email
|
6
|
-
end
|
7
|
-
|
8
|
-
def page_title(subject)
|
9
|
-
name = "Mumuki#{Organization.current.title_suffix}"
|
10
|
-
|
11
|
-
if subject && !subject.new_record?
|
12
|
-
"#{subject.friendly} - #{name}"
|
13
|
-
else
|
14
|
-
"#{name} - #{t :mumuki_catchphrase}"
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
4
|
def profile_picture
|
19
5
|
image_tag(current_user.image_url, height: 40, class: 'img-circle', onError: "this.onerror = null; this.src = '#{image_url('user_shape.png')}'")
|
20
6
|
end
|
@@ -33,14 +19,6 @@ module ApplicationHelper
|
|
33
19
|
end
|
34
20
|
end
|
35
21
|
|
36
|
-
def assistance_box(assignment)
|
37
|
-
if assignment.tips.present?
|
38
|
-
%Q{<div class="mu-tips-box">
|
39
|
-
#{Mumukit::Assistant::Narrator.random.compose_explanation_html assignment.tips}
|
40
|
-
</div>}.html_safe
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
22
|
def chapter_finished(chapter)
|
45
23
|
t :chapter_finished_html, chapter: link_to_path_element(chapter) if chapter
|
46
24
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module AssetsHelper
|
2
|
+
def assets_include_tags
|
3
|
+
%Q{
|
4
|
+
<meta name="turbolinks-cache-control" content="no-cache">
|
5
|
+
#{stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload'}
|
6
|
+
#{javascript_include_tag 'application', 'data-turbolinks-track': 'reload'}
|
7
|
+
<link rel="icon" type="image/x-icon" href="#{Organization.current.favicon_url}" data-turbolinks-track="reload">
|
8
|
+
<link rel="stylesheet" type="text/css" href="#{theme_stylesheet_url}" data-turbolinks-track="reload">
|
9
|
+
<script type="text/javascript" src="#{extension_javascript_url}" defer data-turbolinks-track="reload"></script>
|
10
|
+
}.html_safe
|
11
|
+
end
|
12
|
+
end
|
@@ -21,7 +21,7 @@ module AssignmentResultHelper
|
|
21
21
|
|
22
22
|
def report_bug_link(assignment, organization=Organization.current)
|
23
23
|
if organization.report_issue_enabled?
|
24
|
-
mail_to contact_email,
|
24
|
+
mail_to organization.contact_email,
|
25
25
|
fa_icon(:bug, text: t(:notify_problem_with_exercise), class: 'fa-fw'),
|
26
26
|
subject: t(:problem_with_exercise, title: @exercise.name),
|
27
27
|
body: assignment_help_email_body(assignment),
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module EditorHelper
|
2
|
+
def editor_defaults(language, options, styles = '')
|
3
|
+
{class: styles,
|
4
|
+
data: {placeholder: I18n.t(:editor_placeholder),
|
5
|
+
'editor-language' => language},
|
6
|
+
rows: 15}.deep_merge(options)
|
7
|
+
end
|
8
|
+
|
9
|
+
def read_only_editor(content, language, options = {})
|
10
|
+
editor_options = editor_defaults(language, options, 'read-only-editor')
|
11
|
+
text_area_tag :solution_content, content, editor_options
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module LocaleHelper
|
2
|
+
def locale_tags
|
3
|
+
%Q{
|
4
|
+
<script type="text/javascript">
|
5
|
+
window.mumukiLocale = #{raw Organization.current.locale_json};
|
6
|
+
mumuki.locale = '#{Organization.current.locale}';
|
7
|
+
moment.locale('#{Organization.current.locale}');
|
8
|
+
</script>
|
9
|
+
}.html_safe
|
10
|
+
end
|
11
|
+
end
|
@@ -1,4 +1,17 @@
|
|
1
1
|
module MenuBarHelper
|
2
|
+
def menu_bar_links
|
3
|
+
[
|
4
|
+
link_to_classroom,
|
5
|
+
link_to_bibliotheca,
|
6
|
+
solve_discussions_link,
|
7
|
+
user_discussions_link
|
8
|
+
]
|
9
|
+
end
|
10
|
+
|
11
|
+
def menu_bar_list_items
|
12
|
+
menu_bar_links.compact.map { |link| "<li>#{link}<li>" }.join.html_safe
|
13
|
+
end
|
14
|
+
|
2
15
|
def link_to_classroom
|
3
16
|
link_to_application 'graduation-cap', :classroom, :teacher_here?
|
4
17
|
end
|
@@ -6,4 +6,9 @@ module MultipleFileEditorHelper
|
|
6
6
|
def multifile_locales
|
7
7
|
:insert_file_name.try { |it| { it => t(it) } }
|
8
8
|
end
|
9
|
+
|
10
|
+
def multifile_hidden_inputs
|
11
|
+
hidden_field_tag('highlight-modes', highlight_modes.to_json)
|
12
|
+
hidden_field_tag('multifile-locales', multifile_locales.to_json)
|
13
|
+
end
|
9
14
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module OpenGraphHelper
|
2
|
+
def open_graph_tags(subject)
|
3
|
+
%Q{
|
4
|
+
<meta property="og:site_name" content="#{Organization.current.site_name}" />
|
5
|
+
<meta property="og:title" content="#{page_title subject}"/>
|
6
|
+
<meta property="og:description" content="#{Organization.current.central? ? t(:mumuki_short_description) : Organization.current.description}"/>
|
7
|
+
<meta property="og:type" content="website"/>
|
8
|
+
<meta property="og:image" content="#{Organization.current.open_graph_image_url}"/>
|
9
|
+
<meta property="og:url" content="#{request.original_url}"/>
|
10
|
+
}.html_safe
|
11
|
+
end
|
12
|
+
end
|
@@ -12,7 +12,7 @@
|
|
12
12
|
<%= corollary_box @exercise %>
|
13
13
|
<% else %>
|
14
14
|
<div class="mu-kids-default-success">
|
15
|
-
<img src="/
|
15
|
+
<img src="/kibi_success_dancing.svg" class="capital-animation"/>
|
16
16
|
<p><%= t :kids_default_success %></p>
|
17
17
|
</div>
|
18
18
|
<% end %>
|
@@ -55,7 +55,9 @@
|
|
55
55
|
<div role="tabpanel" class="tab-pane active" id="solution">
|
56
56
|
<div class="mu-tab-body">
|
57
57
|
<div role="tabpanel" class="tab-pane mu-input-panel fade in active" id="editor">
|
58
|
-
|
58
|
+
<div class="mu-read-only-editor">
|
59
|
+
<%= render_exercise_read_only_editor exercise, @discussion.solution %>
|
60
|
+
</div>
|
59
61
|
</div>
|
60
62
|
</div>
|
61
63
|
</div>
|
@@ -6,28 +6,13 @@
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
7
7
|
<% end %>
|
8
8
|
|
9
|
-
<link rel="icon" type="image/x-icon" href="<%= Organization.current.favicon_url %>" data-turbolinks-track="reload">
|
10
|
-
<link rel="stylesheet" type="text/css" href="<%= theme_stylesheet_url %>" data-turbolinks-track="reload">
|
11
|
-
|
12
|
-
<meta property="og:site_name" content="<%= Organization.current.site_name %>" />
|
13
|
-
<meta property="og:title" content="<%= page_title subject %>"/>
|
14
|
-
<meta property="og:description" content="<%= Organization.current.central? ? t(:mumuki_short_description) : Organization.current.description %>"/>
|
15
|
-
<meta property="og:type" content="website"/>
|
16
|
-
<meta property="og:image" content="<%= Organization.current.open_graph_image_url %>"/>
|
17
|
-
<meta property="og:url" content="<%= request.original_url %>"/>
|
18
|
-
|
19
|
-
<meta name="turbolinks-cache-control" content="no-cache">
|
20
|
-
|
21
9
|
<meta name="description" content="<%= t :mumuki_short_description %>"/>
|
22
|
-
|
10
|
+
|
11
|
+
<%= open_graph_tags subject %>
|
12
|
+
<%= assets_include_tags %>
|
23
13
|
<%= csrf_meta_tags %>
|
24
|
-
<%=
|
25
|
-
|
26
|
-
<script type="text/javascript">
|
27
|
-
window.mumukiLocale = <%= raw Organization.current.locale_json %>;
|
28
|
-
mumuki.locale = '<%= Organization.current.locale %>';
|
29
|
-
moment.locale('<%= Organization.current.locale %>');
|
30
|
-
</script>
|
14
|
+
<%= locale_tags %>
|
15
|
+
|
31
16
|
<%= login_form.header_html %>
|
32
17
|
</head>
|
33
18
|
<body>
|
@@ -31,13 +31,8 @@
|
|
31
31
|
<%= profile_picture %>
|
32
32
|
</span>
|
33
33
|
<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="profileDropdown">
|
34
|
-
<li>
|
35
|
-
|
36
|
-
</li>
|
37
|
-
<li><%= link_to_classroom %></li>
|
38
|
-
<li><%= link_to_bibliotheca %></li>
|
39
|
-
<li><%= solve_discussions_link %></li>
|
40
|
-
<li><%= user_discussions_link %></li>
|
34
|
+
<li><%= link_to fixed_fa_icon('user-o', text: t(:profile)), user_path, role: 'menuitem' %></li>
|
35
|
+
<%= menu_bar_list_items %>
|
41
36
|
<li class="divider"></li>
|
42
37
|
<li><%= link_to(t(:sign_out), logout_path(origin: url_for), role: 'menuitem') %></li>
|
43
38
|
</ul>
|
@@ -4,26 +4,25 @@
|
|
4
4
|
<span class="files-tabs">
|
5
5
|
<ul class="nav nav-tabs">
|
6
6
|
<% @files.each_with_index do |file, index| %>
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
<li role="presentation" class="file-tab <%= 'active' if index == 0 %>" data-target="#editor-file-<%= index %>" tabindex='0' data-toggle='tab'>
|
8
|
+
<a class="file-name" href="#"><%= file.name %></a> <i class="delete-file-button fa fa-times"></i>
|
9
|
+
</li>
|
10
10
|
<% end %>
|
11
11
|
</ul>
|
12
12
|
<i class="add-file-button fa fa-plus"></i>
|
13
13
|
</span>
|
14
14
|
|
15
|
-
|
16
|
-
<input id="multifile-locales" type="hidden" value="<%=multifile_locales.to_json%>" />
|
15
|
+
<%= multifile_hidden_inputs %>
|
17
16
|
|
18
17
|
<div class="tab-content">
|
19
18
|
<% @files.each_with_index do |file, index| %>
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
19
|
+
<div role="tabpanel" class="file-editor tab-pane mu-input-panel <%= 'fade in active' if index == 0 %>" id="editor-file-<%= index %>">
|
20
|
+
<%= form.editor "content[#{file.name}]", file.highlight_mode,
|
21
|
+
placeholder: t(:editor_placeholder),
|
22
|
+
class: 'form-control editor',
|
23
|
+
value: file.content,
|
24
|
+
data: {lines: 17} %>
|
25
|
+
</div>
|
27
26
|
<% end %>
|
28
27
|
</div>
|
29
28
|
|