Using AMC in command line only
Version 5 (Eric Le Gallais, 03/07/2021 12:05 am) → Version 6/19 (Eric Le Gallais, 03/07/2021 12:05 am)
h1. Using AMC in command line only
(under construction)
These instructions should help you use AMC in command line only without having to open the graphical user interface.
These instructions work with version 1.1.0 of AMC.
Note that when ou run AMC graphical interface and begin a debugging session (from the Help menu), all AMC commands called by the graphical interface will be recorded in the log file. This can help you to figure out which exact command can do what you need.
h2. Creating a new project
There is no AMC command to create a new project, so you will need to create directories "manually". I use the following bash script to create the directories:
<pre>
#!/bin/bash
# file name: new_project.sh
PROJECT_DIR=$HOME/MC-Projects
mkdir $PROJECT_DIR/$1
mkdir $PROJECT_DIR/$1/cr
mkdir $PROJECT_DIR/$1/cr/corrections
mkdir $PROJECT_DIR/$1/cr/corrections/jpg
mkdir $PROJECT_DIR/$1/cr/corrections/pdf
mkdir $PROJECT_DIR/$1/cr/diagnostic
mkdir $PROJECT_DIR/$1/cr/zooms
mkdir $PROJECT_DIR/$1/data
mkdir $PROJECT_DIR/$1/exports
mkdir $PROJECT_DIR/$1/scans
mkdir $PROJECT_DIR/$1/copies
</pre>
then you can create a new poject by typing:
<pre>
$ ./new_project.sh my-new-project1
</pre>
h2. Prepare tests
You need to have your .tex file created before following with the instructions below.
In the following examples, we will suppose that your latex file name is test.tex
h3. Creating the PDFs
The next step consists of creating the subject file, the correction file and the position file. By typing:
<pre>
$ cd ~/MC-Projects/my-new-project1/
$ auto-multiple-choice prepare --mode s --prefix ./ ./test.tex \
--out-sujet DOC-subject.pdf \
--out-corrige DOC-correction.pdf \
--out-calage DOC-calage.xy
</pre>
This command will create 3 files:
* DOC-subject.pdf is a file containing all copies.
* DOC-correction.pdf is a file with the correct answer checked so you can review the answers.
* DOC-calage.xy is the position file.
You also need to extract the scroing data from the source file. Typing from your project directory: Typing:
<pre>
$ auto-multiple-choice prepare --mode b --prefix ./ ./test.tex --data ./data/
</pre>
This command will create various data SQLite files in the data directory.
h3. Prepare the layout information MEPTEX
The following command will get the layout information from the working document to the layout database:
<pre>
$ /usr/bin/auto-multiple-choice meptex --src $PROJECT_DIR/$1/DOC-calage.xy --data $PROJECT_DIR/$1/data
</pre>
h3. Printing your documents
You can use the DOC-subject.pdf file and print it. However, if you want to create separate files for each students, type the following:
<pre>
$ auto-multiple-choice /usr/bin/auto-multiple-choice imprime --sujet ./DOC-subject.pdf $PROJECT_DIR/$1/DOC-sujet.pdf --data ./data/ $PROJECT_DIR/$1/data/ --methode file --output ./copies/test-%e.pdf $PROJECT_DIR/$1/copies/examen$2-%e.pdf
</pre>
h2. Analysing the copies
/usr/bin/auto-multiple-choice analyse --projet $PROJECT_DIR/$1/ $PROJECT_DIR/$1/scans/*
# Note
/usr/bin/auto-multiple-choice note -data $PROJECT_DIR/$1/data --seuil 0.15
# Association auto
/usr/bin/auto-multiple-choice association-auto --data $PROJECT_DIR/$1/data --notes-id numero-etudiant --liste $PROJECT_DIR/$1/students-list.csv --liste-key no
# Annoter les copies
/usr/bin/auto-multiple-choice annote --projet $PROJECT_DIR/$1/ --data $PROJECT_DIR/$1/data --fich-noms $PROJECT_DIR/$1/students-list.csv --qualite 100 --indicatives 1
# Regroupe les annotations pour avoir un fichier par étudiant
/usr/bin/auto-multiple-choice regroupe --projet $PROJECT_DIR/$1/ --sujet $PROJECT_DIR/$1/DOC-sujet.pdf --fich-noms $PROJECT_DIR/$1/students-list.csv --tex-src $PROJECT_DIR/$1/$2.tex --compose
# Export les notes
/usr/bin/auto-multiple-choice export --data $PROJECT_DIR/$1/data --module ods --fich-noms $PROJECT_DIR/$1/students-list.csv -o $PROJECT_DIR/$1/output-note.ods --option-out nom=NOM-DE-L_EXAMEN
(under construction)
These instructions should help you use AMC in command line only without having to open the graphical user interface.
These instructions work with version 1.1.0 of AMC.
Note that when ou run AMC graphical interface and begin a debugging session (from the Help menu), all AMC commands called by the graphical interface will be recorded in the log file. This can help you to figure out which exact command can do what you need.
h2. Creating a new project
There is no AMC command to create a new project, so you will need to create directories "manually". I use the following bash script to create the directories:
<pre>
#!/bin/bash
# file name: new_project.sh
PROJECT_DIR=$HOME/MC-Projects
mkdir $PROJECT_DIR/$1
mkdir $PROJECT_DIR/$1/cr
mkdir $PROJECT_DIR/$1/cr/corrections
mkdir $PROJECT_DIR/$1/cr/corrections/jpg
mkdir $PROJECT_DIR/$1/cr/corrections/pdf
mkdir $PROJECT_DIR/$1/cr/diagnostic
mkdir $PROJECT_DIR/$1/cr/zooms
mkdir $PROJECT_DIR/$1/data
mkdir $PROJECT_DIR/$1/exports
mkdir $PROJECT_DIR/$1/scans
mkdir $PROJECT_DIR/$1/copies
</pre>
then you can create a new poject by typing:
<pre>
$ ./new_project.sh my-new-project1
</pre>
h2. Prepare tests
You need to have your .tex file created before following with the instructions below.
In the following examples, we will suppose that your latex file name is test.tex
h3. Creating the PDFs
The next step consists of creating the subject file, the correction file and the position file. By typing:
<pre>
$ cd ~/MC-Projects/my-new-project1/
$ auto-multiple-choice prepare --mode s --prefix ./ ./test.tex \
--out-sujet DOC-subject.pdf \
--out-corrige DOC-correction.pdf \
--out-calage DOC-calage.xy
</pre>
This command will create 3 files:
* DOC-subject.pdf is a file containing all copies.
* DOC-correction.pdf is a file with the correct answer checked so you can review the answers.
* DOC-calage.xy is the position file.
You also need to extract the scroing data from the source file. Typing from your project directory: Typing:
<pre>
$ auto-multiple-choice prepare --mode b --prefix ./ ./test.tex --data ./data/
</pre>
This command will create various data SQLite files in the data directory.
h3. Prepare the layout information MEPTEX
The following command will get the layout information from the working document to the layout database:
<pre>
$ /usr/bin/auto-multiple-choice meptex --src $PROJECT_DIR/$1/DOC-calage.xy --data $PROJECT_DIR/$1/data
</pre>
h3. Printing your documents
You can use the DOC-subject.pdf file and print it. However, if you want to create separate files for each students, type the following:
<pre>
$ auto-multiple-choice /usr/bin/auto-multiple-choice imprime --sujet ./DOC-subject.pdf $PROJECT_DIR/$1/DOC-sujet.pdf --data ./data/ $PROJECT_DIR/$1/data/ --methode file --output ./copies/test-%e.pdf $PROJECT_DIR/$1/copies/examen$2-%e.pdf
</pre>
h2. Analysing the copies
/usr/bin/auto-multiple-choice analyse --projet $PROJECT_DIR/$1/ $PROJECT_DIR/$1/scans/*
# Note
/usr/bin/auto-multiple-choice note -data $PROJECT_DIR/$1/data --seuil 0.15
# Association auto
/usr/bin/auto-multiple-choice association-auto --data $PROJECT_DIR/$1/data --notes-id numero-etudiant --liste $PROJECT_DIR/$1/students-list.csv --liste-key no
# Annoter les copies
/usr/bin/auto-multiple-choice annote --projet $PROJECT_DIR/$1/ --data $PROJECT_DIR/$1/data --fich-noms $PROJECT_DIR/$1/students-list.csv --qualite 100 --indicatives 1
# Regroupe les annotations pour avoir un fichier par étudiant
/usr/bin/auto-multiple-choice regroupe --projet $PROJECT_DIR/$1/ --sujet $PROJECT_DIR/$1/DOC-sujet.pdf --fich-noms $PROJECT_DIR/$1/students-list.csv --tex-src $PROJECT_DIR/$1/$2.tex --compose
# Export les notes
/usr/bin/auto-multiple-choice export --data $PROJECT_DIR/$1/data --module ods --fich-noms $PROJECT_DIR/$1/students-list.csv -o $PROJECT_DIR/$1/output-note.ods --option-out nom=NOM-DE-L_EXAMEN