Class: SequentialCheckManual

Inherits:
SequentialCheck show all
Defined in:
lib/ruby_learner/sequential_check_manual.rb

Instance Method Summary collapse

Methods inherited from SequentialCheck

#change_mode, #drill_contents, #instruct_modes, #next_action

Constructor Details

#initialize(x, y) ⇒ SequentialCheckManual

Returns a new instance of SequentialCheckManual.



6
7
8
9
# File 'lib/ruby_learner/sequential_check_manual.rb', line 6

def initialize(x, y)
  super
  @theme_color = File.read("#{@data_dir}/theme_color.txt").chomp
end

Instance Method Details

#action(sec, par) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/ruby_learner/sequential_check_manual.rb', line 11

def action(sec, par)
  puts "section_#{sec}/part_#{par}"
  mode_dir = "#{@gem_dir}/contents/questions/sequential_check/section_#{sec}/part_#{par}"
  %w{lib/workplace.rb lib/sentence.org lib/answer.rb spec/workplace_spec.rb}.each do |path|
    FileUtils.cp("#{mode_dir}/#{path}", "#{@workshop_dir}/#{path}")
  end
  write_final_history(sec, par)
  intro_next_command
  restore = Restore.new
  restore.save(file: "#{@workshop_dir}/lib/workplace.rb", elapsed_time: 0.0)
end

#last_re_actionObject



23
24
25
# File 'lib/ruby_learner/sequential_check_manual.rb', line 23

def last_re_action
  puts "This mode doesn't have last-option"
end