1- # Imports unicode tab-delimited txt file saved from Excel
2- # Arguments are, in order:
3- # filename, author's user id, copyright holder's user id,
4- # skip_first_row, column separator and row separator
5- # Example: rake exercises:import:unicode[exercises.txt,1,2]
6- # will import exercises from exercises.txt and
7- # assign the user with ID 1 as the author and
8- # solution author, and the user with ID 2 as the CR holder
9-
101namespace :exercises do
112 namespace :import do
12-
3+ # Imports exercises from a spreadsheet
4+ # Arguments are, in order:
5+ # filename, author's user id, copyright holder's user id, skip_first_row
6+ # Example: rake exercises:import:excel[exercises.xlsx,1,2]
7+ # will import exercises from exercises.xlsx and
8+ # assign the user with ID 1 as the author and
9+ # solution author, and the user with ID 2 as the CR holder
1310 desc "import an Excel file"
1411 task :excel , [ :filename , :author_id , :ch_id , :skip_first_row ] => :environment do |t , args |
1512 # Output import logging info to the console (except in the test environment)
@@ -24,6 +21,13 @@ namespace :exercises do
2421 end
2522 end
2623
24+ # Imports exercises from a zip file
25+ # Arguments are, in order:
26+ # zip_filename, excel_filename, author's user id, copyright holder's user id, skip_first_row
27+ # Example: rake exercises:import:zip[exercises.zip,exercises.xlsx,1,2]
28+ # will import exercises from exercises.xlsx (within exercises.zip) and
29+ # assign the user with ID 1 as the author and
30+ # solution author, and the user with ID 2 as the CR holder
2731 desc "import a zip file"
2832 task :zip , [ :zip_filename , :excel_filename ,
2933 :author_id , :ch_id , :skip_first_row ] => :environment do |t , args |
0 commit comments