moodle2cc 0.2.35 → 0.2.36

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: 6deb93f985307e6ecc8e93ff19940ec9b53e45b6
4
- data.tar.gz: 93dade76220dc4af4bb462a4fdbba7e02a4cd004
3
+ metadata.gz: 6ac44925322ecddaaf7cc19115d327c63f9e0234
4
+ data.tar.gz: 79ed3fe3389aa07eaa45a97b32df28d68af43ef1
5
5
  SHA512:
6
- metadata.gz: 12f659aa570bcac66727ba9e2e954d175e8d2a6df592f80261abdc13e3bf7ede7ad713ed3d53b976b0ccbc657c6d7509098d2272f918f31ecc3126a88746641d
7
- data.tar.gz: fd4dddc21e033f936963f160f6ff4ad2cb421c1372492f38008ab50a48ebd2c3d82a29a21d47b0a1670eda7f4985540dfcc9b1e6509bc49fcf4876f5ed7c1067
6
+ metadata.gz: f98c2b02672703f03784a9150a0b078fc5c682738906b8ce861ae3daf1b267d3fa04ef876da5b9de94d8a1255cd0e04aa4d82ca7727569973e1c0c70c117759c
7
+ data.tar.gz: fb4c28bfc4e8cd06864129c2d217a6fba7f83706a3b46631ce2e756f308633aa9a28f6f1de176f59c834c77fd4ee4eaa30b84ec030186e4c63cfd2021bb746a2
@@ -4,7 +4,22 @@ module Moodle2CC::Moodle2Converter
4
4
 
5
5
  def convert(moodle_file)
6
6
  canvas_file = Moodle2CC::CanvasCC::Models::CanvasFile.new
7
- canvas_file.identifier = moodle_file.content_hash
7
+
8
+ unique_id = moodle_file.content_hash
9
+ # we probably shouldn't have been using these as identifiers but if we change it now we'll break updates on re-import
10
+
11
+ id_set = Moodle2Converter::Migrator.unique_id_set
12
+ if id_set.include?(unique_id)
13
+ original_id = unique_id
14
+ index = 0
15
+ while id_set.include?(unique_id)
16
+ index += 1
17
+ unique_id = "#{original_id}#{index}"
18
+ end
19
+ end
20
+ id_set << unique_id
21
+
22
+ canvas_file.identifier = unique_id
8
23
  canvas_file.file_path = moodle_file.file_path + moodle_file.file_name
9
24
  canvas_file.file_location = moodle_file.file_location
10
25
  canvas_file
@@ -62,7 +62,7 @@ module Moodle2CC::Moodle2Converter
62
62
 
63
63
  def convert_files(files)
64
64
  file_converter = Moodle2CC::Moodle2Converter::FileConverter.new
65
- Array.new(files.uniq { |f| f.content_hash }).map { |file| file_converter.convert(file) }
65
+ Array.new(files).map { |file| file_converter.convert(file) }
66
66
  end
67
67
 
68
68
  def convert_pages(pages)
@@ -1,3 +1,3 @@
1
1
  module Moodle2CC
2
- VERSION = "0.2.35"
2
+ VERSION = "0.2.36"
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.35
4
+ version: 0.2.36
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: 2016-07-28 00:00:00.000000000 Z
13
+ date: 2016-09-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rubyzip