@@ -123,43 +123,6 @@ download_exercise <- function(exercise_id,
123
123
url_config = url_config )
124
124
}
125
125
126
-
127
- # ' @title Upload an exercise to the TMC server
128
- # '
129
- # ' @description Upload an exercise to the TMC server
130
- # '
131
- # ' @usage upload_exercise(token, exercise_id, project_path, server_address,
132
- # ' zip_name = "temp", remove_zip = TRUE)
133
- # '
134
- # ' @param token \code{OAuth2} token associated with the current login
135
- # ' session.
136
- # ' @param exercise_id ID of the submitted exercise.
137
- # ' @param project_path File path to the directory of the submitted
138
- # ' exercise.
139
- # ' @param server_address Address of the TMC server where the exercise is
140
- # ' submitted to.
141
- # ' @param zip_name Name of the \code{zip} file which contains the
142
- # ' exercise submission. Default is \code{temp}
143
- # ' @param remove_zip \code{TRUE} or \code{FALSE} depending on if you
144
- # ' wish to delete the submission \code{zip} file after sending it to the
145
- # ' server. Defaults to \code{TRUE}.
146
- # '
147
- # ' @details Packs the exercise directory into a \code{zip} file and
148
- # ' sends it to the TMC server as a list.
149
- # '
150
- # ' @return \code{HTTP} response to the submission attempt.
151
- # '
152
- # ' @seealso \code{\link[httr]{add_headers}},
153
- # ' \code{\link[httr]{upload_file}}, \code{\link[httr]{POST}},
154
- # ' \code{\link[base]{file.remove}}
155
-
156
- # Zips and uploads a single exercise, which is located in project_path.
157
- # Returns the response, which contains a field $submission_url
158
- # containing the details of the submission.
159
- upload_exercise <- function (token , exercise_id , project_path ,
160
- server_address , zip_name = " temp" ,
161
- remove_zip = TRUE ) {
162
- url_data <- .upload_exercise1(token , exercise_id , server_address )
163
126
.upload_exercise2 <- function (url_data , project_path , remove_zip ) {
164
127
exercises_response <- list ()
165
128
exercises_url <- url_data $ exercises_url
@@ -212,6 +175,44 @@ upload_exercise <- function(token, exercise_id, project_path,
212
175
213
176
return (exercises_response )
214
177
}
178
+
179
+
180
+ # ' @title Upload an exercise to the TMC server
181
+ # '
182
+ # ' @description Upload an exercise to the TMC server
183
+ # '
184
+ # ' @usage upload_exercise(token, exercise_id, project_path, server_address,
185
+ # ' zip_name = "temp", remove_zip = TRUE)
186
+ # '
187
+ # ' @param token \code{OAuth2} token associated with the current login
188
+ # ' session.
189
+ # ' @param exercise_id ID of the submitted exercise.
190
+ # ' @param project_path File path to the directory of the submitted
191
+ # ' exercise.
192
+ # ' @param server_address Address of the TMC server where the exercise is
193
+ # ' submitted to.
194
+ # ' @param zip_name Name of the \code{zip} file which contains the
195
+ # ' exercise submission. Default is \code{temp}
196
+ # ' @param remove_zip \code{TRUE} or \code{FALSE} depending on if you
197
+ # ' wish to delete the submission \code{zip} file after sending it to the
198
+ # ' server. Defaults to \code{TRUE}.
199
+ # '
200
+ # ' @details Packs the exercise directory into a \code{zip} file and
201
+ # ' sends it to the TMC server as a list.
202
+ # '
203
+ # ' @return \code{HTTP} response to the submission attempt.
204
+ # '
205
+ # ' @seealso \code{\link[httr]{add_headers}},
206
+ # ' \code{\link[httr]{upload_file}}, \code{\link[httr]{POST}},
207
+ # ' \code{\link[base]{file.remove}}
208
+
209
+ # Zips and uploads a single exercise, which is located in project_path.
210
+ # Returns the response, which contains a field $submission_url
211
+ # containing the details of the submission.
212
+ upload_exercise <- function (token , exercise_id , project_path ,
213
+ server_address , zip_name = " temp" ,
214
+ remove_zip = TRUE ) {
215
+ url_data <- .upload_exercise1(token , exercise_id , server_address )
215
216
.upload_exercise2(url_data , project_path , remove_zip )
216
217
}
217
218
0 commit comments