moodle2cc 0.2.44 → 0.2.46

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
  SHA256:
3
- metadata.gz: 8baf72f07d2a65667b1a1e8d8f62f0e87141e3c0e4cf719cb1502acefb89d70e
4
- data.tar.gz: 3968532ffd944fb71159b2df750ad7bc5910868ade76cf94a6f95033b5274a15
3
+ metadata.gz: 939e7d8dd8334a8cf1582e1e00fc06c49155d2d5e7da6dab985250d0ea866f39
4
+ data.tar.gz: 2996e02a9626488b09f05be63f0ed0b4bdaed241472650814bb60ed8b7b65acf
5
5
  SHA512:
6
- metadata.gz: d542c7bd25ccfddb029d128beb3bc6e3178087934ccf862a1488a341936b3393d6ca04899e9942d7776ed05ca739f7d7ec0b18b3154f525eec1adea4cf3d6389
7
- data.tar.gz: 1908583476f19256292888175ed355e5d3e90b0fc2203cd4604be7bbf849885a96fa4f252263c500c8b6c0a272ffc060ebf50e70b07810557780f3bf6c1f906d
6
+ metadata.gz: f42977ae253921b0ee2251b88b0a9eec71c9ae9ab485b65ccdda1706c797be6ada640a3f34c66248f9482125fa92ce085c8e5a231e38e753f2249a8b587a9ea4
7
+ data.tar.gz: 18e5c56f7d8bf6e80032b06147e57fc22c927a0cb565b1d088fed3cc315886013db0e9deff9dfb929ea93354802682dabe98e316f512085aa3543692ff4e18e2
@@ -37,7 +37,7 @@ module Moodle2CC::CanvasCC
37
37
  end.to_xml
38
38
 
39
39
  file_path = File.join(@work_dir, assessment.meta_file_path)
40
- FileUtils.mkdir_p(File.dirname(file_path)) unless File.exists?(File.dirname(file_path))
40
+ FileUtils.mkdir_p(File.dirname(file_path)) unless File.exist?(File.dirname(file_path))
41
41
  File.open(file_path, 'w') { |f| f.write(xml) }
42
42
  end
43
43
 
@@ -75,8 +75,8 @@ module Moodle2CC::CanvasCC
75
75
  end.to_xml
76
76
 
77
77
  file_path = File.join(@work_dir, assessment.qti_file_path)
78
- FileUtils.mkdir_p(File.dirname(file_path)) unless File.exists?(File.dirname(file_path))
78
+ FileUtils.mkdir_p(File.dirname(file_path)) unless File.exist?(File.dirname(file_path))
79
79
  File.open(file_path, 'w') { |f| f.write(xml) }
80
80
  end
81
81
  end
82
- end
82
+ end
@@ -37,8 +37,8 @@ module Moodle2CC::CanvasCC
37
37
  end.to_xml
38
38
 
39
39
  file_path = File.join(@work_dir, bank_resource.href)
40
- FileUtils.mkdir_p(File.dirname(file_path)) unless File.exists?(File.dirname(file_path))
40
+ FileUtils.mkdir_p(File.dirname(file_path)) unless File.exist?(File.dirname(file_path))
41
41
  File.open(file_path, 'w') { |f| f.write(xml) }
42
42
  end
43
43
  end
44
- end
44
+ end
@@ -13,7 +13,7 @@ module Moodle2CC
13
13
  @destination = destination
14
14
  @format = options['format'] || 'cc'
15
15
  Moodle2CC::Logger.logger = options['logger'] || ::Logger.new(STDOUT)
16
- raise(Moodle2CC::Error, "'#{@source}' does not exist") unless File.exists?(@source)
16
+ raise(Moodle2CC::Error, "'#{@source}' does not exist") unless File.exist?(@source)
17
17
  raise(Moodle2CC::Error, "'#{@destination}' is not a directory") unless File.directory?(@destination)
18
18
  raise(Moodle2CC::Error, "'#{@format}' is not a valid format. Please use 'cc' or 'canvas'.") unless ['cc', 'canvas'].include?(@format)
19
19
  @converter_class = @format == 'cc' ? Moodle2CC::CC::Converter : Moodle2CC::Canvas::Converter
@@ -51,9 +51,9 @@ module Moodle2CC
51
51
 
52
52
  def moodle_version
53
53
  if File.directory?(@source)
54
- if File.exists?(File.join(@source, 'moodle_backup.xml'))
54
+ if File.exist?(File.join(@source, 'moodle_backup.xml'))
55
55
  MOODLE_2
56
- elsif File.exists?(File.join(@source, 'moodle.xml'))
56
+ elsif File.exist?(File.join(@source, 'moodle.xml'))
57
57
  MOODLE_1_9
58
58
  end
59
59
  else
@@ -68,4 +68,4 @@ module Moodle2CC
68
68
  end
69
69
 
70
70
  end
71
- end
71
+ end
@@ -39,7 +39,7 @@ module Moodle2CC::Moodle2::Parsers
39
39
  file.repository_id = parse_text(node, 'repositoryid')
40
40
  file.reference = parse_text(node, 'reference')
41
41
  file.file_location = File.join(@work_dir, FILES_DIR, file.content_hash[0..1], file.content_hash)
42
- if file.file_size > 0 && File.exists?(file.file_location)
42
+ if file.file_size > 0 && File.exist?(file.file_location)
43
43
  files << file
44
44
  else
45
45
  missing_files << file
@@ -49,4 +49,4 @@ module Moodle2CC::Moodle2::Parsers
49
49
  end
50
50
 
51
51
  end
52
- end
52
+ end
@@ -47,7 +47,7 @@ module Moodle2CC::Moodle2::Parsers
47
47
  forum.completion_posts = parse_text(forum_xml, "/activity/#{module_name}/completionposts")
48
48
  end
49
49
  grade_file = File.join(activity_dir, "grades.xml")
50
- if File.exists?(grade_file)
50
+ if File.exist?(grade_file)
51
51
  File.open(grade_file) do |f|
52
52
  grade_xml = Nokogiri::XML(f)
53
53
  if node = grade_xml.at_xpath("activity_gradebook/grade_items/grade_item/grademax")
@@ -60,4 +60,4 @@ module Moodle2CC::Moodle2::Parsers
60
60
  end
61
61
 
62
62
  end
63
- end
63
+ end
@@ -32,7 +32,7 @@ module Moodle2CC::Moodle2
32
32
  category.parent = parse_text(node, "parent")
33
33
  category.sort_order = parse_text(node, "sortorder")
34
34
 
35
- category.questions += node.search("questions/question").filter_map { |question_node| question_parser(question_node) }
35
+ category.questions += node.search("./questions/question").filter_map { |question_node| question_parser(question_node) }
36
36
  category.questions += node.search("question_bank_entries/question_bank_entry").map do |question_bank_entry|
37
37
  question_bank_entry.search("question_version/question_versions").map do |question_versions|
38
38
  question_versions.search("questions/question").map do |question_node|
@@ -1,3 +1,3 @@
1
1
  module Moodle2CC
2
- VERSION = "0.2.44"
2
+ VERSION = "0.2.46"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moodle2cc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.44
4
+ version: 0.2.46
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Durtschi
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-01-30 00:00:00.000000000 Z
13
+ date: 2024-04-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rubyzip
@@ -424,7 +424,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
424
424
  - !ruby/object:Gem::Version
425
425
  version: '0'
426
426
  requirements: []
427
- rubygems_version: 3.3.3
427
+ rubygems_version: 3.5.3
428
428
  signing_key:
429
429
  specification_version: 4
430
430
  summary: Migrates Moodle backup ZIP to IMS Common Cartridge package