Warning
This script is outdated and incompatible with the current platform. The repository has been archived. Please wait for the author's upcoming update.
A Python script which finishes the exam in YOOC without a question bank automatically.
- Python 3
- Required Python libraries:
beautifulsoup4pycryptodomerequestsurllib3
You can install the required libraries using pip:
pip install -r requirements.txtThe configuration file config.json contains your credentials and settings for the automated exam. You can manually gather the necessary information and insert it into the configuration file.
{
"user_token": "",
"sessionid": "",
"examId": "",
"time": 5,
"accuracy": 100
}Parameters in config.json:
- user_token: The token for user authentication.
- sessionid: The session ID for user session management.
- examId: The ID of the exam to be taken.
- time: The expected exam duration, in minutes.
- accuracy: The expected accuracy level for the answers (as a percentage, e.g., 80 for 80%).
- Log in to yooc.me in your web browser.
- Open your browser's Developer Tools (usually by pressing
F12orCtrl+Shift+I). - Navigate to the Network tab and look for Cookies.
- You will find the
user_tokenandsessionidstored in the list. - Copy their values and paste them into the
config.jsonfile.
- Go to the Exam Details page in your browser.
- Open your Developer Tools again and navigate to the Network tab.
- Look for the request whose URL starts with
https://exambackend.yooc.me/api/exam/list/get. - Click on that request, and in the Response section, the response will contain the
examIdof the exam. - Copy the
examIdvalue and paste it into theconfig.jsonfile.
Make sure all the values are correctly copied into the config.json file for the script to function properly.
-
Ensure your
config.jsonfile is properly configured with your credentials and preferences. -
Run the script with:
python yooc_exam.py
This will start the automated exam.
-
Waiting for the script test. Generally speaking, the waiting duration is roughly equal to the expected test duration.
The following operations are optional.
The to_wrong.py module is used to generate wrong answers for fill-in-the-blank (completion) questions. It takes the correct answer as input and returns a wrong answer.
Default Behavior:
The
to_wrongfunction, by default, turns the answer into a period (".") if the answer is a string. For non-string answers (like lists), it recursively applies theto_wrong()function to each item in the list.def to_wrong(answer): """ Customize the wrong answer based on the correct one. This function is triggered for fill-in-the-blank questions. """ if isinstance(answer, str): return '.' else: return [to_wrong(item) for item in answer]
You can modify the to_wrong() function by applying more complex logic for different types of answers in the specific exam.
The script will incorporate noise in the test duration. This noise is based on the noise parameters in yooc_exam.py.
noise = 0.1 # noise of sleep timeIts default value is 0.1, which means there is a 10% discrepancy between the actual duration and the expected duration. You can adjust the noise variable in the script to make the random delay smaller or larger, depending on your needs.
- This script is for educational purposes only. I am not responsible for any consequences that may arise from the use of this script. Please ensure you comply with all relevant laws, terms of service, and ethical guidelines when using this script.
- The accuracy level for the answers is based on the desired percentage. The script will attempt to modify the answers to achieve this accuracy.
- The actual exam duration will incorporate a small amount of noise to simulate human behavior.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for more details.