@@ -260,6 +260,39 @@ def set_config(api: ApiClient, exercise_id, file_name, useJson):
260
260
api .update_exercise_config (exercise_id , config )
261
261
262
262
263
+ @cli .command ()
264
+ @click .argument ("exercise_id" )
265
+ @click .option ("--excavate/--archive" , "excavate" , default = False )
266
+ @pass_api_client
267
+ def set_archived (api : ApiClient , exercise_id , excavate ):
268
+ """
269
+ Set the archived flag of an exercise (put it into archived mode or excavate from archive).
270
+ """
271
+ api .set_exercise_archived (exercise_id , not excavate )
272
+
273
+
274
+ @cli .command ()
275
+ @click .argument ("exercise_id" )
276
+ @click .argument ("author" )
277
+ @pass_api_client
278
+ def set_author (api : ApiClient , exercise_id , author ):
279
+ """
280
+ Change the author of the exercise.
281
+ """
282
+ api .set_exercise_author (exercise_id , author )
283
+
284
+
285
+ @cli .command ()
286
+ @click .argument ("exercise_id" )
287
+ @click .option ('--admin' , '-a' , multiple = True )
288
+ @pass_api_client
289
+ def set_admins (api : ApiClient , exercise_id , admin ):
290
+ """
291
+ Set exercise admins (replaces current list of admins).
292
+ """
293
+ api .set_exercise_admins (exercise_id , admin )
294
+
295
+
263
296
@cli .command ()
264
297
@click .option ('--stats' , is_flag = True )
265
298
@pass_api_client
@@ -321,3 +354,14 @@ def tags_remove_global(api: ApiClient, tag):
321
354
"""
322
355
res = api .exercise_tags_remove_global (tag )
323
356
click .echo ("{} exercise(s) affected" .format (res ["count" ]))
357
+
358
+
359
+ @cli .command ()
360
+ @click .argument ("ref_solution_id" )
361
+ @click .argument ("visibility" )
362
+ @pass_api_client
363
+ def set_ref_solution_visibility (api : ApiClient , ref_solution_id , visibility ):
364
+ """
365
+ Change visibility of a reference solution.
366
+ """
367
+ api .update_reference_solution_visibility (ref_solution_id , int (visibility ))
0 commit comments