moodle2cc 0.2.44 → 0.2.45

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: 98689e50dc5e33cde859b130da10873353ecd86ef81e4aa765beb9dd969f87d3
4
+ data.tar.gz: 8d58e5bcc83ef54b9387913f5594693e39b74f9a67c5546f8a42e3795ad2bec8
5
5
  SHA512:
6
- metadata.gz: d542c7bd25ccfddb029d128beb3bc6e3178087934ccf862a1488a341936b3393d6ca04899e9942d7776ed05ca739f7d7ec0b18b3154f525eec1adea4cf3d6389
7
- data.tar.gz: 1908583476f19256292888175ed355e5d3e90b0fc2203cd4604be7bbf849885a96fa4f252263c500c8b6c0a272ffc060ebf50e70b07810557780f3bf6c1f906d
6
+ metadata.gz: 4854cb70b2fb66f4bd26c8bf5ee6d6464131bd32b6101a4e2abd28100ae9ec80a86eb4f350c412847aca612df38199ebf71573daa7ef5ffe5c54a656e699e0db
7
+ data.tar.gz: b08f962f311ee2cf4806af2a85a6abd4df96549abfa796807f10ce521d4d7abe531f6c8146be75aa3242fbfe944fce0da58a5613f3537a541c64a533290cf911
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Moodle2CC
2
- VERSION = "0.2.44"
2
+ VERSION = "0.2.45"
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.45
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-03-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rubyzip