Upload and share annotated papers with ownCloudNextCloud
Version 1 (Rémi G., 03/19/2018 10:53 am)
1 | 1 | h1. Presentation |
|
---|---|---|---|
2 | 1 | ||
3 | 1 | "AMCtoOwncloud":https://github.com/remjg/AMCtoOwncloud is a _Nautilus script_ that sends Auto Multiple Choice (AMC) annotated papers to Owncloud/Nextcloud and share them with the corresponding students. |
|
4 | 1 | ||
5 | 1 | Each quiz file is uploaded to a remote folder unique to each student. Then each folder is: |
|
6 | 1 | ||
7 | 1 | * _shared with the student_ who can be a local user or a remote user on another federated server |
|
8 | 1 | * _shared by link_ |
|
9 | 1 | ||
10 | 1 | Eventually, _shared links are saved_ to a newly created @.csv@ file (default behaviour) or to the current @.csv@ file. |
|
11 | 1 | ||
12 | 1 | In the end, the remote folder structure will look like this: |
|
13 | 1 | ||
14 | 1 | <pre> |
|
15 | 1 | Quizzes/ |
|
16 | 1 | ├── 3emeE/ |
|
17 | 1 | | ├── MOUSE Mickey (3998) - Maths Quizzes/ |
|
18 | 1 | │ │ └── Quiz 1 - MOUSE Mickey (3998).pdf |
|
19 | 1 | │ └── MOUSE Minnie (3999) - Maths Quizzes/ |
|
20 | 1 | │ └── Quiz 1 - MOUSE Minnie (3999).pdf |
|
21 | 1 | └── 4emeE/ |
|
22 | 1 | └── DUCK Donald (4999) - Maths Quizzes/ |
|
23 | 1 | └── Quiz 1 - DUCK Donald (3999).pdf |
|
24 | 1 | </pre> |
|
25 | 1 | ||
26 | 1 | The root folder @Quizzes/@, @Quiz 1@, and @Maths Quizzes@ are configurable, and the other fields come from the @.csv@ file. |
|
27 | 1 | For instance, if you don't have groups specified in you @.csv@ file, and you leave the root folder empty @''@, it can also look like this: |
|
28 | 1 | ||
29 | 1 | <pre> |
|
30 | 1 | MOUSE Mickey (3998) - Maths Quizzes/ |
|
31 | 1 | └── Quiz 1 - MOUSE Mickey (3998).pdf |
|
32 | 1 | MOUSE Minnie (3999) - Maths Quizzes/ |
|
33 | 1 | └── Quiz 1 - MOUSE Minnie (3999).pdf |
|
34 | 1 | DUCK Donald (4999) - Maths Quizzes/ |
|
35 | 1 | └── Quiz 1 - DUCK Donald (3999).pdf |
|
36 | 1 | </pre> |
|
37 | 1 | ||
38 | 1 | h1. Use |
|
39 | 1 | ||
40 | 1 | _Right click_ on the annotated papers (or on folders) and go to the submenu _scripts_: |
|
41 | 1 | ||
42 | 1 | !https://github.com/remjg/AMCtoOwncloud/raw/master/docs/UsingScript1-Menu.png! |
|
43 | 1 | ||
44 | 1 | Then enter your _Owncloud_ password, the name of the quiz, and wait: |
|
45 | 1 | ||
46 | 1 | !https://github.com/remjg/AMCtoOwncloud/raw/master/docs/UsingScript2-Output.png! |
|
47 | 1 | ||
48 | 1 | Every encountered issue should be displayed (unmatched files, login error, uploading or sharing errors). |
|
49 | 1 | ||
50 | 1 | h1. Installation |
|
51 | 1 | ||
52 | 1 | Download the "latest release from github":https://github.com/remjg/AMCtoOwncloud/releases/latest and copy @AMCtoOwncloud.sh@ and @.AMCtoOwncloud.py@ in the _Nautilus scripts_ folder: @~/.local/share/nautilus/scripts/@ |
|
53 | 1 | ||
54 | 1 | !https://github.com/remjg/AMCtoOwncloud/raw/master/docs/InstallingScript.png! |
|
55 | 1 | ||
56 | 1 | In order to make it work, you need to install the following Python modules: |
|
57 | 1 | ||
58 | 1 | @requests@, @lxml.html@, @owncloud@ (see "pyocclient":https://github.com/owncloud/pyocclient). |
|
59 | 1 | ||
60 | 1 | Usually the first are packaged in your distribution. For the @owncloud@ package, I use the following command: |
|
61 | 1 | ||
62 | 1 | <pre> |
|
63 | 1 | pip3 install pyocclient |
|
64 | 1 | </pre> |
|
65 | 1 | ||
66 | 1 | You also need @gnome-terminal@ or you will have to edit the @AMCtoOwncloud.sh@ script file to use another terminal. |
|
67 | 1 | ||
68 | 1 | h1. Configuration |
|
69 | 1 | ||
70 | 1 | Edit the @.AMCtoOwncloud.py@ and change the parameters at the end: |
|
71 | 1 | ||
72 | 1 | <pre><code class="python"> |
|
73 | 1 | CSV = '/path/to/csv/students.csv' |
|
74 | 1 | FOLDER = 'Quizzes/' |
|
75 | 1 | ADDRESS = 'https://ncloud.zaclys.com' |
|
76 | 1 | USERNAME = 'MyUserName' |
|
77 | 1 | </code></pre> |
|
78 | 1 | ||
79 | 1 | The CSV file containing all your student information must use semicolons @;@ as separators and the following headers (there are optional parameters in method @identify_students()@ to change this behaviour, see "Special use cases":https://project.auto-multiple-choice.net/projects/auto-multiple-choice/wiki/Upload_and_share_with_ownCloud_or_NextCloud#Special-use-cases): |
|
80 | 1 | ||
81 | 1 | <pre> |
|
82 | 1 | group;surname;name;id;owncloud;email |
|
83 | 1 | 3emeE;MOUSE;Mickey;3998;cabitzmil;mickeymouse@domain.com |
|
84 | 1 | 3emeE;MOUSE;Minnie;3999;agrevet;minniemouse@domain.com |
|
85 | 1 | 4emeE;DUCK;Donald;4999;prenaud@aFederatedServer.com;donaldduck@domain.com |
|
86 | 1 | </pre> |
|
87 | 1 | ||
88 | 1 | Finally, *annotated papers must contain the student number in their name* |
|
89 | 1 | (the first number of the file name is extracted to associate each quiz to the corresponding student). Don't forget to configure @auto-multiple-choice@ using the column headers of your @.csv@ file: |
|
90 | 1 | ||
91 | 1 | !https://github.com/remjg/AMCtoOwncloud/raw/master/docs/RenamingAnnotatedPapers.png! |
|
92 | 1 | ||
93 | 1 | h1. Special use cases |
|
94 | 1 | ||
95 | 1 | To change the script behaviour, you can edit the last four lines: |
|
96 | 1 | ||
97 | 1 | <pre><code class="python"> |
|
98 | 1 | amcsend = AMCtoOwncloud() |
|
99 | 1 | amcsend.identify_students(csv_filepath=CSV) |
|
100 | 1 | amcsend.connect_owncloud(address=ADDRESS, username=USERNAME, SSO=False) |
|
101 | 1 | amcsend.upload_and_share(folder_root=FOLDER, replace_csv=False) |
|
102 | 1 | </code></pre> |
|
103 | 1 | ||
104 | 1 | For instance, if your _Owncloud_ server is behind a _Central Authentication Service (CAS)_, you might want to use the parameter @SSO=True@. It has been tested with the Virtual Learning Environment "Envole":https://envole.ac-dijon.fr of a school that use CAS fo authentication. |
|
105 | 1 | ||
106 | 1 | You can also save shared links to the _current_ @.csv@ file with @replace_csv=True@. Make sure to backup before and be aware that _comment lines starting with a @#@ are lost in the process_. |
|
107 | 1 | ||
108 | 1 | More options are available, see below for a full list of parameters with default values: |
|
109 | 1 | ||
110 | 1 | <pre><code class="python"> |
|
111 | 1 | amcsend = AMCtoOwncloud(list_of_paths=None, verbose=False) |
|
112 | 1 | amcsend.identify_students(csv_filepath=CSV, verbose=False, debug=False, |
|
113 | 1 | csv_delimiter=";", |
|
114 | 1 | csv_comment="#", |
|
115 | 1 | name_header="name", |
|
116 | 1 | surname_header="surname", |
|
117 | 1 | group_header="group", |
|
118 | 1 | number_header="id", |
|
119 | 1 | email_header="email", |
|
120 | 1 | owncloud_header="owncloud", |
|
121 | 1 | link_header="link") |
|
122 | 1 | amcsend.connect_owncloud(address=ADDRESS, username=USERNAME, password=None, SSO=False) |
|
123 | 1 | amcsend.upload_and_share(folder_root=FOLDER, folder_name=" - Maths Quizzes", |
|
124 | 1 | quiz_name=None, |
|
125 | 1 | share_with_user=True, |
|
126 | 1 | share_by_link=True, |
|
127 | 1 | replace_csv=False) |
|
128 | 1 | </code></pre> |
|
129 | 1 | ||
130 | 1 | h1. Generating information letters |
|
131 | 1 | ||
132 | 1 | A LaTeX document is also available in the folder @/information letters/@ to print share links together with the corresponding QR codes: |
|
133 | 1 | ||
134 | 1 | !https://raw.githubusercontent.com/remjg/AMCtoOwncloud/master/docs/InformationLetter.png! |
|
135 | 1 | ||
136 | 1 | h1. Personal comments |
|
137 | 1 | ||
138 | 1 | Sending annotated papers was complicated for me: |
|
139 | 1 | ||
140 | 1 | * I work in junior high school and not every student/parent has an email. |
|
141 | 1 | * If they have an email, they don't always remember it (or they don't want to be contacted !) |
|
142 | 1 | * Emails are often marked as spam |
|
143 | 1 | * You can't send too many mails at the same time |
|
144 | 1 | ||
145 | 1 | Hence, using a cloud is easier. Even if the students don't have a cloud account at school: you can give them the share link on a paper and they (including their parents) can access to all the graded tests. |
|
146 | 1 | ||
147 | 1 | I will try in a future version to automatically shorten links. |