mumuki-laboratory 6.1.3 → 6.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c1f824531443ee3ee14cf97a2acbd049f9d611d8
4
- data.tar.gz: eb6344fdc81b6d5358653b1dfc129e3fe55bae25
3
+ metadata.gz: 4948fb4a53aa2b8a644d30e277ba22e36c97f288
4
+ data.tar.gz: d8eb048fc90d467600a0ece58095e09475c82df3
5
5
  SHA512:
6
- metadata.gz: 56129d9c051b1f8013b1d557fbc5798fb4b1aaa4d8f4f15022d2a34594bd0f2fa0b835ebb83c53f5803d7344893d7431c759c0bc5df123e50453b5368e3aaf55
7
- data.tar.gz: dc1defcca5fb41a697633734b79c41525143f78b90eec70e33bdcd0dffdce2a73ab3deb5b6ba325bfe2df04a7e885512e88fa1d223750900ac8a2182eda28126
6
+ metadata.gz: 56267fa13ab108b5eb6b2fef47b0b51abe837c09783e7189b59f3f4afa6dcfeac1886ee8f7a50cc9ef208a999c90d0e17ecdbc40b7990050b7f1db0d85da765c
7
+ data.tar.gz: 882babf2c0a112c9682637910378db3612121b8e8448ac27f80095b8b4aec2453a5ba907d503a74776aeb415fa233aa22071b1c1cd6a2fdc33882e3f4b12aa8b
@@ -1,5 +1,5 @@
1
1
  module Mumuki
2
2
  module Laboratory
3
- VERSION = '6.1.3'
3
+ VERSION = '6.1.4'
4
4
  end
5
5
  end
@@ -10,7 +10,7 @@
10
10
  #
11
11
  # It's strongly recommended that you check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema.define(version: 20181117190241) do
13
+ ActiveRecord::Schema.define(version: 20181121165956) do
14
14
 
15
15
  # These are extensions that must be enabled in order to support this database
16
16
  enable_extension "plpgsql"
@@ -158,7 +158,7 @@ ActiveRecord::Schema.define(version: 20181117190241) do
158
158
  t.boolean "new_expectations", default: false
159
159
  t.boolean "manual_evaluation", default: false
160
160
  t.integer "editor", default: 0, null: false
161
- t.string "choices", default: [], null: false, array: true
161
+ t.string "choice_values", default: [], null: false, array: true
162
162
  t.text "goal"
163
163
  t.string "initial_state"
164
164
  t.string "final_state"
@@ -166,6 +166,7 @@ ActiveRecord::Schema.define(version: 20181117190241) do
166
166
  t.text "randomizations"
167
167
  t.text "free_form_editor_source"
168
168
  t.text "teacher_info"
169
+ t.text "choices"
169
170
  t.index ["guide_id"], name: "index_exercises_on_guide_id"
170
171
  t.index ["language_id"], name: "index_exercises_on_language_id"
171
172
  end
@@ -12,7 +12,7 @@ feature 'Exercise Flow', organization_workspace: :test do
12
12
  let!(:problem_4) { build(:problem, name: 'Succ4', description: 'Description of Succ4', layout: :input_bottom, extra: 'x = 2') }
13
13
  let!(:problem_5) { build(:problem, name: 'Succ5', description: 'Description of Succ5', layout: :input_right, editor: :upload, hint: 'lele', language: gobstones) }
14
14
  let!(:problem_6) { build(:problem, name: 'Succ6', description: 'Description of Succ6', layout: :input_right, editor: :hidden, language: haskell) }
15
- let!(:problem_7) { build(:problem, name: 'Succ7', description: 'Description of Succ7', choices: ['some choice']) }
15
+ let!(:problem_7) { build(:problem, name: 'Succ7', description: 'Description of Succ7', choices: [{value: 'some choice', checked: true}]) }
16
16
  let!(:playground_1) { build(:playground, name: 'Succ5', description: 'Description of Succ4', layout: :input_right) }
17
17
  let!(:playground_2) { build(:playground, name: 'Succ6', description: 'Description of Succ4', layout: :input_right, extra: 'x = 4') }
18
18
  let!(:reading) { build(:reading, name: 'Reading about Succ', description: 'Lets understand succ history') }
@@ -7,10 +7,10 @@ describe BreadcrumbsHelper, organization_workspace: :test do
7
7
  helper ERB::Util
8
8
 
9
9
  context 'user' do
10
- let(:user) { create(:user) }
10
+ let(:user) { create(:user, first_name: "Alfonsina", last_name: "Storni") }
11
11
  let(:breadcrumb) { breadcrumbs(user) }
12
12
 
13
- it { expect(breadcrumb).to include "<li class='mu-breadcrumb-list-item last'>#{user.name}</li>" }
13
+ it { expect(breadcrumb).to include "<li class='mu-breadcrumb-list-item last'>Alfonsina Storni</li>" }
14
14
  end
15
15
 
16
16
  context 'exercise' do
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe ChoicesHelper do
4
4
  helper ChoicesHelper
5
5
 
6
- context 'exercise width choices' do
6
+ context 'exercise with choices' do
7
7
  let(:checked_content) { struct id: '1', index: 0, value: 'foo', text: 'bar' }
8
8
  let(:unchecked_content) { struct id: '3', index: 2, value: 'baz', text: 'lorem' }
9
9
  let(:content) { '0:1' }
@@ -4,6 +4,30 @@ describe Exercise, organization_workspace: :test do
4
4
  let(:exercise) { create(:exercise) }
5
5
  let(:user) { create(:user, first_name: 'Orlo') }
6
6
 
7
+ describe '#choice_values' do
8
+ context 'when choices are in 5.0 format' do
9
+ let(:choice_values) { %w(1492 1453 1773) }
10
+ let(:exercise) { build(:exercise, description: 'when did byzantine empire fall?', choice_values: choice_values) }
11
+
12
+ it { expect(exercise.choices).to be_blank }
13
+ it { expect(exercise[:choice_values]).to eq choice_values }
14
+ it { expect(exercise.choice_values).to eq choice_values }
15
+ it { expect(exercise.choice_index_for '1492').to eq 0 }
16
+ it { expect(exercise.choice_index_for '1773').to eq 2 }
17
+ end
18
+
19
+ context 'when choices are in 6.0 format' do
20
+ let(:choices) { [{value: '1492', checked: false}, {value: '1453', checked: true}, {value: '1773', checked: false}] }
21
+ let(:exercise) { build(:exercise, description: 'when did byzantine empire fall?', choices: choices) }
22
+
23
+ it { expect(exercise.choices).to eq choices }
24
+ it { expect(exercise[:choice_values]).to be_blank }
25
+ it { expect(exercise.choice_values).to eq %w(1492 1453 1773) }
26
+ it { expect(exercise.choice_index_for '1492').to eq 0 }
27
+ it { expect(exercise.choice_index_for '1773').to eq 2 }
28
+ end
29
+ end
30
+
7
31
  describe '#slug' do
8
32
  let(:guide) { create(:guide, slug: 'foo/bar') }
9
33
  let(:exercise) { create(:exercise, guide: guide, bibliotheca_id: 4) }
@@ -55,7 +55,7 @@ describe Guide do
55
55
  extra: '',
56
56
  language: { name: 'text' },
57
57
  test: "---\nequal: '1'\n",
58
- choices: [{value: 'foo', checked: false}, {value: 'bar', chekced: true}],
58
+ choices: [{value: 'foo', checked: false}, {value: 'bar', checked: true}],
59
59
  extra_visible: false,
60
60
  id: 8},
61
61
  {type: 'reading',
@@ -148,7 +148,8 @@ describe Guide do
148
148
  it { expect(guide.exercises.second.language).to eq haskell }
149
149
  it { expect(guide.exercises.second.default_content).to eq 'a default content' }
150
150
  it { expect(guide.exercises.second.extra_visible).to be true }
151
- it { expect(guide.exercises.fourth.choices).to eq ['foo', 'bar'] }
151
+ it { expect(guide.exercises.fourth.choices).to eq [{'value' => 'foo', 'checked' => false}, {'value' => 'bar', 'checked' => true}] }
152
+ it { expect(guide.exercises.fourth.choice_values).to eq ['foo', 'bar'] }
152
153
 
153
154
  it { expect(guide.exercises.third.expectations.first['binding']).to eq 'foo' }
154
155
 
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.1.3
4
+ version: 6.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Bulgarelli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-23 00:00:00.000000000 Z
11
+ date: 2018-11-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: 6.1.3
33
+ version: 6.1.4
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: 6.1.3
40
+ version: 6.1.4
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: mumukit-login
43
43
  requirement: !ruby/object:Gem::Requirement