Skip to content

Add scripts for uploading CE exerciese

lanhuang requested to merge uploadce into master

Code Expert upload tool

This is a python script that helps uploading CE projects.

Dependency

Please install following dependent packages in python (>=3.6) using pip install --user or conda install

  • selenium
  • requests

Selenium also requires a Firefox browser driver. You need to install the Firefox browser and download the geckodriver. Please note down the executable path of geckodriver and specify it to this script.

Get Started

  1. Login Code Expert and create an empty exercise
  2. Click into the exercise and copy its url, should be in the form of "https://expert.ethz.ch/ide2/"
  3. Find the absolute path for the exercise folder, should include solution and template subfolders
  4. Find the absolute path for Testing script folder, should be Testing folder inside NumCSE repo
  5. Call this script with infomation found above: python uploadce.py --driver_path <DRIVER_PATH> --exercise_url <EXERCISE_URL> --exercise_path <EXERCISE_PATH> --testscript_path <TESTSCRIPT_PATH>
  6. The script will open an automated Firefox window, and direct to Code Expert login page, please login with your ETH identity and wait for the uploading process
  7. The script will firstly upload the solution folder. When it finishes, please fix all the visibility settings in the solution folder, and press any button in the command line to continue uploading process. This process is to avoid duplicated files in template folder if one fix the visibility of the solution folder after uploading finishes.

Problems

  • When having timeout errors, rerunning the script may solve the issue
  • This script cannot setup the visibility properties for all the files, you may need to config manually for some files
Edited by lanhuang

Merge request reports