Documentation ¶
Index ¶
- Variables
- func AddComments(fileNames ...string)
- func AddCommentsInBatch(manager s3.FileManager) error
- func AddCommentsToFile(answerID int, fileName, outputName string, deleteComments bool) error
- func Execute()
- func HandleAnswers(manager s3.FileManager) error
- func HandleProblems(manager s3.FileManager) (err error)
- func HandleQuestions(manager s3.FileManager) error
Constants ¶
This section is empty.
Variables ¶
var Db *gorm.DB
Db - shared DB connection
var RootCmd = &cobra.Command{
Use: "extract-blocks",
Short: "Extracts Cell Formula Blocks from Excel file and writes to MySQL",
Long: `Extracts Cell Formula Blocks from Excel file and writes to MySQL.
Conditions that define Cell Formula Block -
(i) Any contiguous (unbroken) range of excel cells containing cell formula
(ii) Contiguous cells could be either in a row or in a column or in row+column cell block.
(iii) The formula in the range of cells should be the same except the changes due to relative cell references.
Connection should be defined using connection URL notation: DRIVER://CONNECIONT_PARAMETERS,
where DRIVER is either "mysql" or "sqlite", e.g., mysql://user:password@tcp(SERVER:PORT)/dbname?charset=utf8&parseTime=True&loc=Local.
More examples on connection parameter you can find at: https://github.com/go-sql-driver/mysql#examples.`,
}
RootCmd represents the base command when called without any subcommands
Functions ¶
func AddComments ¶
func AddComments(fileNames ...string)
AddComments addes comments to the given file from the DB and stores file with the given name
func AddCommentsInBatch ¶
func AddCommentsInBatch(manager s3.FileManager) error
AddCommentsInBatch addes comments to the answer files.
func AddCommentsToFile ¶
AddCommentsToFile addes chart properties and comments to the answer files.
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func HandleAnswers ¶
func HandleAnswers(manager s3.FileManager) error
HandleAnswers - iterates through student answers and retrievs answer workbooks it thaks the funcion that actuatualy performs file download from S3 bucket and returns the downloades file name or an error.
func HandleProblems ¶
func HandleProblems(manager s3.FileManager) (err error)
HandleProblems - iterates through questions, downloads the all files and inport all cells into DB
func HandleQuestions ¶
func HandleQuestions(manager s3.FileManager) error
HandleQuestions - iterates through questions, downloads the all files and inport all cells into DB
Types ¶
This section is empty.