mumuki-laboratory 5.5.0 → 5.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/application/discussions.js +43 -0
- data/app/assets/stylesheets/application/_modules.scss +2 -0
- data/app/assets/stylesheets/application/modules/_checkboxes.scss +21 -8
- data/app/assets/stylesheets/application/modules/_discussion.scss +339 -0
- data/app/assets/stylesheets/application/modules/_pagination.scss +10 -0
- data/app/controllers/application_controller.rb +4 -9
- data/app/controllers/book_discussions_controller.rb +7 -0
- data/app/controllers/chapters_controller.rb +2 -0
- data/app/controllers/discussions_controller.rb +65 -0
- data/app/controllers/discussions_messages_controller.rb +25 -0
- data/app/controllers/exercises_controller.rb +1 -0
- data/app/controllers/guide_container_controller.rb +1 -0
- data/app/controllers/messages_controller.rb +1 -1
- data/app/controllers/users_controller.rb +1 -0
- data/app/helpers/application_helper.rb +7 -0
- data/app/helpers/assignment_result_helper.rb +10 -30
- data/app/helpers/breadcrumbs_helper.rb +7 -3
- data/app/helpers/contextualization_result_helper.rb +31 -0
- data/app/helpers/discussions_helper.rb +163 -0
- data/app/helpers/exercise_input_helper.rb +33 -5
- data/app/helpers/icons_helper.rb +20 -3
- data/app/helpers/messages_helper.rb +4 -0
- data/app/helpers/status_helper.rb +2 -2
- data/app/models/assignment.rb +31 -47
- data/app/models/book.rb +3 -0
- data/app/models/chapter.rb +2 -0
- data/app/models/concerns/contextualization.rb +85 -0
- data/app/models/concerns/submittable/solvable.rb +1 -0
- data/app/models/concerns/with_assignments.rb +1 -1
- data/app/models/concerns/with_discussion_creation.rb +9 -0
- data/app/models/concerns/with_discussion_creation/subscription.rb +33 -0
- data/app/models/concerns/with_discussion_creation/upvote.rb +28 -0
- data/app/models/concerns/with_discussion_status.rb +11 -0
- data/app/models/concerns/with_discussions.rb +23 -0
- data/app/models/concerns/with_randomizations.rb +34 -0
- data/app/models/concerns/with_scoped_queries.rb +47 -0
- data/app/models/concerns/with_scoped_queries/filter.rb +15 -0
- data/app/models/concerns/with_scoped_queries/page.rb +10 -0
- data/app/models/concerns/with_scoped_queries/sort.rb +47 -0
- data/app/models/discussion.rb +128 -0
- data/app/models/exercise.rb +10 -1
- data/app/models/guide.rb +1 -1
- data/app/models/message.rb +24 -3
- data/app/models/organization.rb +4 -0
- data/app/models/submission/confirmation.rb +1 -1
- data/app/models/submission/console_submission.rb +1 -1
- data/app/models/submission/submission.rb +13 -0
- data/app/models/subscription.rb +12 -0
- data/app/models/topic.rb +1 -1
- data/app/models/upvote.rb +4 -0
- data/app/models/user.rb +3 -2
- data/app/views/book_discussions/index.html.erb +23 -0
- data/app/views/chapters/show.html.erb +0 -1
- data/app/views/discussions/_message.html.erb +22 -0
- data/app/views/discussions/_message_container.html.erb +8 -0
- data/app/views/discussions/_new_message.html.erb +19 -0
- data/app/views/discussions/index.html.erb +30 -0
- data/app/views/discussions/show.html.erb +76 -0
- data/app/views/exercise_solutions/_contextualization_results.html.erb +21 -0
- data/app/views/exercise_solutions/_contextualization_results_container.html.erb +4 -0
- data/app/views/exercise_solutions/_expectations.html.erb +9 -3
- data/app/views/exercise_solutions/_kids_results.html.erb +1 -1
- data/app/views/exercise_solutions/_results.html.erb +21 -55
- data/app/views/exercise_solutions/_results_title.html.erb +2 -2
- data/app/views/exercises/_exercise_assignment.html.erb +20 -0
- data/app/views/exercises/_read_only.html.erb +104 -0
- data/app/views/exercises/show.html.erb +4 -20
- data/app/views/layouts/_discussions.html.erb +68 -0
- data/app/views/layouts/_kids.html.erb +9 -6
- data/app/views/layouts/_messages.html.erb +1 -1
- data/app/views/layouts/_result.html.erb +2 -2
- data/app/views/layouts/_test_results.html.erb +6 -6
- data/app/views/layouts/application.html.erb +10 -9
- data/app/views/layouts/exercise_inputs/forms/_form.html.erb +5 -6
- data/app/views/layouts/exercise_inputs/forms/_interactive_form.html.erb +5 -5
- data/app/views/layouts/exercise_inputs/forms/_kids_form.html.erb +9 -17
- data/app/views/layouts/exercise_inputs/forms/_playground_form.html.erb +5 -5
- data/app/views/layouts/exercise_inputs/forms/_problem_form.html.erb +11 -11
- data/app/views/layouts/exercise_inputs/forms/_reading_form.html.erb +1 -1
- data/app/views/layouts/exercise_inputs/layouts/_input_bottom.html.erb +1 -1
- data/app/views/layouts/exercise_inputs/layouts/_input_kids.html.erb +7 -7
- data/app/views/layouts/exercise_inputs/layouts/_input_right.html.erb +1 -1
- data/app/views/layouts/exercise_inputs/read_only_editors/_code.html.erb +3 -0
- data/app/views/layouts/exercise_inputs/read_only_editors/_custom.html.erb +6 -0
- data/app/views/layouts/exercise_inputs/read_only_editors/_multiple_choice.html.erb +8 -0
- data/app/views/layouts/exercise_inputs/read_only_editors/_single_choice.html.erb +8 -0
- data/app/views/layouts/modals/_kids_context.html.erb +2 -2
- data/app/views/layouts/modals/_new_discussion.html.erb +27 -0
- data/app/views/users/show.html.erb +23 -3
- data/config/routes.rb +21 -1
- data/db/migrate/20180504173548_create_discussions.rb +12 -0
- data/db/migrate/20180504185845_add_discussion_id_to_message.rb +5 -0
- data/db/migrate/20180605143727_add_submission_to_discussion.rb +16 -0
- data/db/migrate/20180619182555_create_subscriptions.rb +9 -0
- data/db/migrate/20180702153442_create_upvotes.rb +8 -0
- data/db/migrate/20180702175220_add_upvotes_count_to_discussions.rb +5 -0
- data/db/migrate/20180704150839_rename_assignment_status_to_submission_status.rb +5 -0
- data/lib/mumuki/laboratory.rb +2 -0
- data/lib/mumuki/laboratory/controllers.rb +2 -1
- data/lib/mumuki/laboratory/controllers/content.rb +12 -0
- data/lib/mumuki/laboratory/controllers/notifications.rb +31 -0
- data/lib/mumuki/laboratory/controllers/results_rendering.rb +1 -1
- data/lib/mumuki/laboratory/engine.rb +0 -2
- data/lib/mumuki/laboratory/evaluation/manual.rb +1 -1
- data/lib/mumuki/laboratory/locales/en.yml +37 -1
- data/lib/mumuki/laboratory/locales/es.yml +42 -1
- data/lib/mumuki/laboratory/locales/pt.yml +33 -1
- data/lib/mumuki/laboratory/status.rb +51 -44
- data/lib/mumuki/laboratory/status/discussion/closed.rb +15 -0
- data/lib/mumuki/laboratory/status/discussion/discussion.rb +56 -0
- data/lib/mumuki/laboratory/status/discussion/opened.rb +27 -0
- data/lib/mumuki/laboratory/status/discussion/pending_review.rb +15 -0
- data/lib/mumuki/laboratory/status/discussion/solved.rb +19 -0
- data/lib/mumuki/laboratory/status/submission/aborted.rb +11 -0
- data/lib/mumuki/laboratory/status/submission/errored.rb +15 -0
- data/lib/mumuki/laboratory/status/{failed.rb → submission/failed.rb} +2 -2
- data/lib/mumuki/laboratory/status/submission/manual_evaluation_pending.rb +15 -0
- data/lib/mumuki/laboratory/status/{passed.rb → submission/passed.rb} +2 -2
- data/lib/mumuki/laboratory/status/{passed_with_warnings.rb → submission/passed_with_warnings.rb} +2 -2
- data/lib/mumuki/laboratory/status/submission/pending.rb +11 -0
- data/lib/mumuki/laboratory/status/submission/running.rb +11 -0
- data/lib/mumuki/laboratory/status/submission/submission.rb +49 -0
- data/lib/mumuki/laboratory/status/{unknown.rb → submission/unknown.rb} +2 -2
- data/lib/mumuki/laboratory/version.rb +1 -1
- data/spec/controllers/chapters_controller_spec.rb +17 -0
- data/spec/controllers/discussions_controller_spec.rb +19 -0
- data/spec/dummy/config/environments/development.rb +0 -2
- data/spec/dummy/config/environments/test.rb +0 -2
- data/spec/dummy/db/schema.rb +42 -2
- data/spec/evaluation_helper.rb +1 -1
- data/spec/factories/discussion_factory.rb +8 -0
- data/spec/features/dynamic_exam_spec.rb +1 -1
- data/spec/helpers/exercise_input_helper_spec.rb +25 -0
- data/spec/helpers/test_results_rendering_spec.rb +7 -7
- data/spec/models/assignment_spec.rb +17 -2
- data/spec/models/discussion_spec.rb +153 -0
- metadata +108 -27
- data/app/models/concerns/with_status.rb +0 -43
- data/app/models/status_rendering_verbosity.rb +0 -40
- data/lib/mumuki/laboratory/controllers/messages.rb +0 -9
- data/lib/mumuki/laboratory/status/aborted.rb +0 -7
- data/lib/mumuki/laboratory/status/base.rb +0 -47
- data/lib/mumuki/laboratory/status/errored.rb +0 -15
- data/lib/mumuki/laboratory/status/manual_evaluation_pending.rb +0 -15
- data/lib/mumuki/laboratory/status/pending.rb +0 -11
- data/lib/mumuki/laboratory/status/running.rb +0 -11
- data/spec/models/randomizer_spec.rb +0 -18
- data/spec/models/verbosity_spec.rb +0 -24
@@ -33,28 +33,12 @@
|
|
33
33
|
<% end %>
|
34
34
|
</div>
|
35
35
|
|
36
|
-
|
37
36
|
<% content_for :assignment do %>
|
38
|
-
|
39
|
-
|
40
|
-
</div>
|
41
|
-
<div class="row">
|
42
|
-
<div class="col-md-12">
|
43
|
-
<div class="hint-box <%= 'hidden' if @exercise.hint.blank? %>">
|
44
|
-
<% if @exercise.hint.present? %>
|
45
|
-
<a data-toggle="collapse" href="#hint-section" class="text-info">
|
46
|
-
<%= fa_icon 'lightbulb-o' %> <%= t :need_a_hint %>
|
47
|
-
</a>
|
37
|
+
<%= render partial: 'exercise_assignment', locals: {exercise: @exercise} %>
|
38
|
+
<% end %>
|
48
39
|
|
49
|
-
|
50
|
-
|
51
|
-
<%= @exercise.hint_html %>
|
52
|
-
</p>
|
53
|
-
</div>
|
54
|
-
<% end %>
|
55
|
-
</div>
|
56
|
-
</div>
|
57
|
-
</div>
|
40
|
+
<%= content_for :exercise_content do %>
|
41
|
+
<%= render partial: 'layouts/exercise_inputs/forms/form', locals: {exercise: @exercise} %>
|
58
42
|
<% end %>
|
59
43
|
|
60
44
|
<%= render_exercise_input_layout(@exercise) %>
|
@@ -0,0 +1,68 @@
|
|
1
|
+
<div class="discussions-list">
|
2
|
+
<%= discussions_reset_query_link %>
|
3
|
+
<div class="discussions-toolbar">
|
4
|
+
<div class="discussions-toolbar-status">
|
5
|
+
<div class="hidden-xs hidden-sm">
|
6
|
+
<% discussions_statuses.each do |status| %>
|
7
|
+
<%= discussion_status_filter_link(status, @discussions) %>
|
8
|
+
<% end %>
|
9
|
+
</div>
|
10
|
+
</div>
|
11
|
+
<div>
|
12
|
+
<div class="hidden-md hidden-lg ">
|
13
|
+
<%= discussion_dropdown_filter :status, discussions_statuses do |status_filter| %>
|
14
|
+
<%= t status_filter %>
|
15
|
+
<% end %>
|
16
|
+
</div>
|
17
|
+
|
18
|
+
<%= yield :extra_filters %>
|
19
|
+
|
20
|
+
<%= discussion_dropdown_filter :sort, Discussion.sorting_filters do |sorting_filter| %>
|
21
|
+
<%= t sorting_filter %>
|
22
|
+
<% end %>
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
<% if @filtered_discussions.empty? %>
|
26
|
+
<div class="discussions-no-filtered-results">
|
27
|
+
<div>
|
28
|
+
<%= fa_icon('exclamation-circle', class: 'fa-lg') %>
|
29
|
+
</div>
|
30
|
+
<span>
|
31
|
+
<%= t :no_discussions %>
|
32
|
+
</span>
|
33
|
+
</div>
|
34
|
+
<% else %>
|
35
|
+
<div class="discussions">
|
36
|
+
<% @filtered_discussions.each do |discussion| %>
|
37
|
+
<%= link_to item_discussion_path(discussion) do %>
|
38
|
+
<div class="discussion">
|
39
|
+
<div class="discussion-row">
|
40
|
+
<%= discussion_messages_icon(discussion) %>
|
41
|
+
<% unless @debatable.respond_to? :language %>
|
42
|
+
<div class="discussion-language-icon">
|
43
|
+
<%= language_icon(discussion.language) %>
|
44
|
+
</div>
|
45
|
+
<% end %>
|
46
|
+
<div>
|
47
|
+
<div class="discussion-title">
|
48
|
+
<span class="discussion-status-icon">
|
49
|
+
<%= discussion_status_fa_icon(discussion) %>
|
50
|
+
</span>
|
51
|
+
<%= discussion.title %>
|
52
|
+
</div>
|
53
|
+
<span class="discussion-description">
|
54
|
+
<%= discussion.description %>
|
55
|
+
</span>
|
56
|
+
</div>
|
57
|
+
</div>
|
58
|
+
</div>
|
59
|
+
<% end %>
|
60
|
+
<% end %>
|
61
|
+
</div>
|
62
|
+
|
63
|
+
<div class="discussion-pagination">
|
64
|
+
<%= paginate @filtered_discussions %>
|
65
|
+
</div>
|
66
|
+
|
67
|
+
<% end %>
|
68
|
+
</div>
|
@@ -1,18 +1,21 @@
|
|
1
1
|
<img src="/anim_amarillo.svg" alt="">
|
2
|
-
<div class="mu-kids-character-speech-bubble <%= 'no-tabs' unless
|
3
|
-
<% if
|
2
|
+
<div class="mu-kids-character-speech-bubble <%= 'no-tabs' unless exercise.hint? %>">
|
3
|
+
<% if exercise.hint? %>
|
4
4
|
<ul class="mu-kids-character-speech-bubble-tabs">
|
5
|
-
<li class="active" data-target="description" title="<%= t :task %>"
|
5
|
+
<li class="active" data-target="description" title="<%= t :task %>">
|
6
|
+
<i class="fa fa-fw fa-file-text-o"></i>
|
6
7
|
</li>
|
7
8
|
<li class="separator"></li>
|
8
|
-
<li data-target="hint" title="<%= t :need_a_hint %>"
|
9
|
+
<li data-target="hint" title="<%= t :need_a_hint %>">
|
10
|
+
<i class="fa fa-fw fa-lightbulb-o"></i>
|
11
|
+
</li>
|
9
12
|
</ul>
|
10
13
|
<% end %>
|
11
14
|
<div class="mu-kids-character-speech-bubble-normal">
|
12
15
|
<i class="mu-kids-prev-speech fa fa-fw fa-caret-up"></i>
|
13
16
|
<i class="mu-kids-next-speech fa fa-fw fa-caret-down"></i>
|
14
|
-
<div class="description"><%=
|
15
|
-
<div class="hint" style="display: none"><%=
|
17
|
+
<div class="description"><%= exercise.description_task %></div>
|
18
|
+
<div class="hint" style="display: none"><%= exercise.hint_html %></div>
|
16
19
|
</div>
|
17
20
|
<div class="mu-kids-character-speech-bubble-failed <%= @assignment&.status %>" style="display: none"></div>
|
18
21
|
</div>
|
@@ -8,7 +8,7 @@
|
|
8
8
|
</a>
|
9
9
|
</li>
|
10
10
|
<% messages.each do |message| %>
|
11
|
-
<li class="<%= message
|
11
|
+
<li class="<%= sender_class(message) %>">
|
12
12
|
<div class="message">
|
13
13
|
<p> <%= message.content_html %></p>
|
14
14
|
<div class="sender"><%= message.sender unless message.sender == current_user_uid %></div>
|
@@ -1,15 +1,15 @@
|
|
1
|
-
<% if
|
2
|
-
<%=
|
1
|
+
<% if contextualization.single_visual_result? %>
|
2
|
+
<%= contextualization.single_visual_result_html %>
|
3
3
|
<% else %>
|
4
4
|
<strong><%= t :test_results %>:</strong>
|
5
5
|
<ul class="results-list">
|
6
|
-
<%
|
6
|
+
<% contextualization.test_results.each_with_index do |test_result, index| %>
|
7
7
|
<li>
|
8
8
|
<% if test_result[:status].failed? %>
|
9
9
|
<span class="text-danger">
|
10
10
|
<%= status_icon(test_result[:status]) %>
|
11
11
|
<strong class="example-title"><%= test_result[:title] %></strong>
|
12
|
-
<% unless
|
12
|
+
<% unless contextualization.visible_success_output? %>
|
13
13
|
<a data-toggle="collapse" href="#example-result-<%= index %>" class="example-see-more">Ver detalles</a>
|
14
14
|
<% end %>
|
15
15
|
</span>
|
@@ -20,8 +20,8 @@
|
|
20
20
|
</span>
|
21
21
|
<% end %>
|
22
22
|
|
23
|
-
<div class="example-result collapse <%= 'in' if
|
24
|
-
<%=
|
23
|
+
<div class="example-result collapse <%= 'in' if contextualization.visible_success_output? %>" id="example-result-<%= index %>">
|
24
|
+
<%= contextualization.output_content_type.to_html test_result[:result] %>
|
25
25
|
</div>
|
26
26
|
</li>
|
27
27
|
<% end %>
|
@@ -55,23 +55,24 @@
|
|
55
55
|
<div class="mu-navbar-avatar">
|
56
56
|
<% if current_user? %>
|
57
57
|
<div class="dropdown">
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
58
|
+
<span>
|
59
|
+
<a class="notifications-box <%= has_notifications? ? '' : 'notifications-box-empty' %>" href=<%= "#{user_notifications_path}" %>>
|
60
|
+
<i class="fa fa-bell fa-fw fa-lg"></i>
|
61
|
+
<span class="badge badge-notifications"><%= notifications_count %></span>
|
62
|
+
</a>
|
63
|
+
</span>
|
64
64
|
</div>
|
65
65
|
<div class="dropdown">
|
66
|
-
|
67
|
-
|
68
|
-
|
66
|
+
<span id="profileDropdown" data-toggle="dropdown" aria-label="<%= t(:user) %>" role="menu" tabindex="0">
|
67
|
+
<%= image_tag(current_user.image_url, height: 40, class: 'img-circle') %>
|
68
|
+
</span>
|
69
69
|
<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="profileDropdown">
|
70
70
|
<li>
|
71
71
|
<%= link_to fixed_fa_icon('user-o', text: t(:profile)), user_path, role: 'menuitem' %>
|
72
72
|
</li>
|
73
73
|
<li><%= link_to_classroom %></li>
|
74
74
|
<li><%= link_to_bibliotheca %></li>
|
75
|
+
<li><%= solve_discussions_link %></li>
|
75
76
|
<li class="divider"></li>
|
76
77
|
<li><%= link_to(t(:sign_out), logout_path(origin: url_for), role: 'menuitem') %></li>
|
77
78
|
</ul>
|
@@ -1,11 +1,10 @@
|
|
1
1
|
<% if current_user? %>
|
2
|
-
<% if
|
3
|
-
<%= hidden_field_tag(:stateful_console,
|
4
|
-
<%= hidden_field_tag(:prompt,
|
2
|
+
<% if exercise.console? %>
|
3
|
+
<%= hidden_field_tag(:stateful_console, exercise.stateful_console?) %>
|
4
|
+
<%= hidden_field_tag(:prompt, exercise.prompt) %>
|
5
5
|
<% end %>
|
6
|
-
|
7
|
-
|
8
|
-
</div>
|
6
|
+
<%= render_exercise_input_form exercise %>
|
7
|
+
|
9
8
|
<% else %>
|
10
9
|
<p><%= t :you_must_sign_in_before_submitting %></p>
|
11
10
|
|
@@ -1,10 +1,10 @@
|
|
1
|
-
<%= hidden_field_tag :console_endpoint, exercise_tries_path(
|
1
|
+
<%= hidden_field_tag :console_endpoint, exercise_tries_path(exercise) %>
|
2
2
|
<%= hidden_field_tag :historical_queries, @assignment&.queries_with_results.to_json %>
|
3
3
|
|
4
|
-
<% if
|
4
|
+
<% if exercise.extra_visible? %>
|
5
5
|
<ul class="nav nav-tabs" role="tablist">
|
6
6
|
<%= console_tab %>
|
7
|
-
<% if
|
7
|
+
<% if exercise.extra_visible? %>
|
8
8
|
<%= extra_code_tab %>
|
9
9
|
<% end %>
|
10
10
|
</ul>
|
@@ -15,7 +15,7 @@
|
|
15
15
|
<% if @assignment&.pending_messages? %>
|
16
16
|
<span class="pending-messages-text"> <%= t :pending_messages_explanation %>
|
17
17
|
<a href="javascript:{}"
|
18
|
-
onclick="mumuki.Chat.submitMessagesForm('<%= messages_url(
|
18
|
+
onclick="mumuki.Chat.submitMessagesForm('<%= messages_url(exercise) %>', '<%= read_messages_path(exercise) %>')"
|
19
19
|
class="<%= hidden_pending(@assignment) %>"
|
20
20
|
data-waiting="<%= t(:sending_solution) %>">
|
21
21
|
<%= t :get_messages %>
|
@@ -29,7 +29,7 @@
|
|
29
29
|
</div>
|
30
30
|
</div>
|
31
31
|
<div role="tabpanel" class="tab-pane mu-input-panel fade" id="visible-extra">
|
32
|
-
<%=
|
32
|
+
<%= exercise.extra_preview_html(current_user) %>
|
33
33
|
</div>
|
34
34
|
<div role="tabpanel" class="tab-pane mu-input-panel fade" id="messages">
|
35
35
|
<%= render partial: 'layouts/messages', locals: {messages: @assignment.messages} if @assignment %>
|
@@ -1,20 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
<%= render_exercise_input_editor f, @exercise %>
|
1
|
+
<%= form_for([exercise, @solution],
|
2
|
+
remote: true,
|
3
|
+
html: {role: 'form', class: 'new_solution mu-editor mu-editor-overlap'}) do |f| %>
|
4
|
+
<%= render_exercise_input_editor f, exercise %>
|
6
5
|
|
7
|
-
|
8
|
-
|
9
|
-
</div>
|
10
|
-
<div class="actions mu-kids-reset-button"></div>
|
11
|
-
<img class="mu-kids-compass-rose" src="/compass_rose.svg">
|
12
|
-
<div class="mu-kids-overlay" style="display: none"></div>
|
13
|
-
<% end %>
|
14
|
-
<% else %>
|
15
|
-
<p><%= t :you_must_sign_in_before_submitting %></p>
|
16
|
-
|
17
|
-
<div class="actions">
|
18
|
-
<%= login_button class: 'btn btn-success btn-block' %>
|
6
|
+
<div class="actions mu-kids-submit-button">
|
7
|
+
<%= render_submit_button(exercise) %>
|
19
8
|
</div>
|
9
|
+
<div class="actions mu-kids-reset-button"></div>
|
10
|
+
<img class="mu-kids-compass-rose" src="/compass_rose.svg">
|
11
|
+
<div class="mu-kids-overlay" style="display: none"></div>
|
20
12
|
<% end %>
|
@@ -1,9 +1,9 @@
|
|
1
|
-
<%= hidden_field_tag :console_endpoint, exercise_queries_path(
|
1
|
+
<%= hidden_field_tag :console_endpoint, exercise_queries_path(exercise) %>
|
2
2
|
|
3
|
-
<% if
|
3
|
+
<% if exercise.extra_visible? %>
|
4
4
|
<ul class="nav nav-tabs" role="tablist">
|
5
5
|
<%= console_tab %>
|
6
|
-
<% if
|
6
|
+
<% if exercise.extra_visible? %>
|
7
7
|
<%= extra_code_tab %>
|
8
8
|
<% end %>
|
9
9
|
</ul>
|
@@ -18,9 +18,9 @@
|
|
18
18
|
</div>
|
19
19
|
</div>
|
20
20
|
<div role="tabpanel" class="tab-pane mu-input-panel fade" id="visible-extra">
|
21
|
-
<%=
|
21
|
+
<%= exercise.extra_preview_html(current_user) %>
|
22
22
|
</div>
|
23
23
|
</div>
|
24
24
|
<div class="actions">
|
25
|
-
<%= next_exercise_button
|
25
|
+
<%= next_exercise_button exercise %>
|
26
26
|
</div>
|
@@ -1,18 +1,18 @@
|
|
1
|
-
<%= hidden_field_tag(:exercise_language,
|
2
|
-
<%= hidden_field_tag :console_endpoint, exercise_queries_path(
|
1
|
+
<%= hidden_field_tag(:exercise_language, exercise.highlight_mode) %>
|
2
|
+
<%= hidden_field_tag :console_endpoint, exercise_queries_path(exercise) %>
|
3
3
|
|
4
|
-
<% if should_render_problem_tabs?
|
4
|
+
<% if should_render_problem_tabs? exercise, current_user %>
|
5
5
|
<ul class="nav nav-tabs" role="tablist">
|
6
6
|
<li role="presentation" class="active">
|
7
7
|
<a data-target="#editor" aria-controls="editor" tabindex="0" role="tab" data-toggle="tab" class="editor-tab"><%= fa_icon 'pencil-square' %> <%= t :solution %></a>
|
8
8
|
</li>
|
9
|
-
<% if
|
9
|
+
<% if exercise.extra_visible? %>
|
10
10
|
<%= extra_code_tab %>
|
11
11
|
<% end %>
|
12
|
-
<% if
|
12
|
+
<% if exercise.queriable? %>
|
13
13
|
<%= console_tab %>
|
14
14
|
<% end %>
|
15
|
-
<%= messages_tab
|
15
|
+
<%= messages_tab exercise %>
|
16
16
|
</ul>
|
17
17
|
<% end %>
|
18
18
|
|
@@ -21,20 +21,20 @@
|
|
21
21
|
<% if @assignment&.pending_messages? %>
|
22
22
|
<span class="pending-messages-text"> <%= t :pending_messages_explanation %>
|
23
23
|
<a href="javascript:{}"
|
24
|
-
onclick="mumuki.Chat.submitMessagesForm('<%= messages_url(
|
24
|
+
onclick="mumuki.Chat.submitMessagesForm('<%= messages_url(exercise) %>', '<%= read_messages_path(exercise) %>')"
|
25
25
|
class="<%= hidden_pending(@assignment) %>"
|
26
26
|
data-waiting="<%= t(:sending_solution) %>">
|
27
27
|
<%= t :get_messages %>
|
28
28
|
</a>
|
29
29
|
</span>
|
30
30
|
<% end %>
|
31
|
-
<%= form_for([
|
31
|
+
<%= form_for([exercise, @solution],
|
32
32
|
remote: true,
|
33
33
|
html: {role: 'form', class: "new_solution mu-editor mu-editor-overlap #{pending_messages_filter(@assignment)}"}) do |f| %>
|
34
|
-
<%= render_exercise_input_editor f,
|
34
|
+
<%= render_exercise_input_editor f, exercise %>
|
35
35
|
|
36
36
|
<div class="actions">
|
37
|
-
<%= render_submit_button(
|
37
|
+
<%= render_submit_button(exercise) %>
|
38
38
|
</div>
|
39
39
|
<% end %>
|
40
40
|
</div>
|
@@ -52,7 +52,7 @@
|
|
52
52
|
</div>
|
53
53
|
</div>
|
54
54
|
<div role="tabpanel" class="tab-pane mu-input-panel fade" id="visible-extra">
|
55
|
-
<%=
|
55
|
+
<%= exercise.extra_preview_html(current_user) %>
|
56
56
|
</div>
|
57
57
|
<div role="tabpanel" class="tab-pane mu-input-panel fade" id="messages">
|
58
58
|
<%= render partial: 'layouts/messages', locals: {messages: @assignment.messages} if @assignment %>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<% content_for :no_container do %>
|
2
2
|
|
3
|
-
<div <%= turbolinks_enable_for
|
3
|
+
<div <%= turbolinks_enable_for exercise %>>
|
4
4
|
|
5
5
|
<div class="mu-kids-landscape-support container-fluid">
|
6
6
|
<img src="/anim_amarillo.svg"/>
|
@@ -11,10 +11,10 @@
|
|
11
11
|
|
12
12
|
<div class="mu-kids-exercise-description">
|
13
13
|
<div class="mu-kids-character">
|
14
|
-
<%= render partial: 'layouts/kids' %>
|
14
|
+
<%= render partial: 'layouts/kids', locals: {exercise: exercise} %>
|
15
15
|
</div>
|
16
16
|
<div class="mu-kids-blocks">
|
17
|
-
<%=
|
17
|
+
<%= yield :exercise_content %>
|
18
18
|
</div>
|
19
19
|
</div>
|
20
20
|
|
@@ -22,19 +22,19 @@
|
|
22
22
|
<div class="mu-kids-state mu-state-initial mu-kids-gbs-board-initial">
|
23
23
|
<strong id="mu-initial-state-text"><%= t :initial_state %></strong>
|
24
24
|
<strong id="mu-actual-state-text"><%= t :actual_state %></strong>
|
25
|
-
<div class="mu-kids-state-image"><%=
|
25
|
+
<div class="mu-kids-state-image"><%= exercise.initial_state&.html_safe %></div>
|
26
26
|
</div>
|
27
27
|
<div class="mu-kids-state mu-state-final">
|
28
28
|
<strong><%= t :expected_state %></strong>
|
29
|
-
<div class="mu-kids-state-image"><%=
|
29
|
+
<div class="mu-kids-state-image"><%= exercise.final_state&.html_safe %></div>
|
30
30
|
</div>
|
31
31
|
</div>
|
32
32
|
|
33
33
|
</div>
|
34
34
|
|
35
|
-
<%= render partial: 'layouts/modals/kids_results', locals: {exercise:
|
35
|
+
<%= render partial: 'layouts/modals/kids_results', locals: {exercise: exercise, assignment: @assignment} %>
|
36
36
|
<%= render partial: 'layouts/modals/kids_results_aborted' %>
|
37
|
-
<%= render partial: 'layouts/modals/kids_context', locals: {exercise:
|
37
|
+
<%= render partial: 'layouts/modals/kids_context', locals: {exercise: exercise, assignment: @assignment} %>
|
38
38
|
|
39
39
|
</div>
|
40
40
|
<% end %>
|