Suggestion for Enhancing Custom Score Input in the Evaluation Module

Currently, the evaluation module allows users to select scores via a dropdown menu, but in some cases, we would like to provide users with more flexibility to enter scores. Specifically, we want to allow users to input the highest and lowest scores, and the system will automatically fill in the scores (either numeric or letter-based).

  1. Support for Numeric Input: Users could input a score range (such as a maximum and minimum score), and the system would automatically generate the scores list. This way, users wouldn’t need to select from a dropdown menu but could simply input the range, saving time.
  2. Support for Letter Grading: If the evaluation is based on letter grades (e.g., A, B, C, etc.), the system could automatically fill in the scores based on the alphabetical order, reducing manual input by the user.

For example, in the J.TEST (J-Test - Wikipedia) exam, the total score is 1000 points. Manually entering 1000 individual scores for 100 students is unrealistic and highly inefficient.

I wrote a script for automatic submission. Please replace your own cookie and gibbonScaleID.

import requests

# Define the target URL and headers
url = "https://gibbon.example.com/modules/School%20Admin/gradeScales_manage_edit_grade_addProcess.php"
headers = {
    "Content-Type": "application/x-www-form-urlencoded",
    "Cookie": "",
    "Origin": "https://gibbon.example.com",
    "Referer": "https://gibbon.example.com/index.php?q=%2Fmodules%2FSchool+Admin%2FgradeScales_manage_edit_grade_add.php&gibbonScaleID=",
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36"
}

# Set initial values
value = 0
descriptor = 0
sequenceNumber = 0
max_value = 1000

# Loop incrementing until 1000
while value <= max_value:
    # Request data
    data = {
        "address": "/modules/School Admin/gradeScales_manage_edit_grade_add.php",
        "gibbonScaleID": "<<<!!!REPLACE!!!>>>",
        "value": str(value),
        "descriptor": str(descriptor),
        "sequenceNumber": str(sequenceNumber),
        "isDefault": "N",
    }

    # Encode data into URL format
    encoded_data = '&'.join([f"{key}={value}" for key, value in data.items()])

    # Send POST request
    response = requests.post(url, headers=headers, data=encoded_data, allow_redirects=False)

    # Print the requested URL and response headers
    print(f"Requested URL: {response.url}")
    print(f"Response status code: {response.status_code}")
    print(f"Response headers: {response.headers}")

    # If there is a redirect, print the Location header and follow the redirect
    if response.status_code == 302:
        print(f"Redirected to: {response.headers.get('Location')}")
    else:
        print(f"Submission failed: {response.status_code} - {response.text[:500]}")

    # Increment the values
    value += 1
    descriptor += 1
    sequenceNumber += 1

Hi @AndroidOL

Thank you for your code suggestions. It does look pretty efficient and effective. Would you mind sending a PR to the gibbon/core so that we can evaluate and test it? If it seems beneficial, we might merge it to the core version. Please have a look on how to create a new PR request from this documentation Developer Workflow | Gibbon Documentation
Looking forward to the new feature!

Thank you for your reply, @Ali!

Sorry, but I have never used Git before, and I have no knowledge of collaborative development. Do I just need to fork, commit, and then create a pull request?

I will try to do this in about a week. I’ve been traveling frequently and may not have time to update the bulk addition page to the main branch for now.

Hi @AndroidOL Thanks for asking! To contribute to a project, you typically follow these steps:

  1. Fork the repository: This creates a copy of the project in your own account.
  2. Clone the repository to your local machine: This allows you to work on the project locally.
  3. Make changes (e.g., update the bulk addition page): Modify the files as needed.
  4. Commit your changes: This saves your changes.
  5. Push your changes to your fork: Upload your local changes to your remote repository.
  6. Create a pull request: This requests that your changes be merged into the main branch.

Feel free to take your time, and when you’re ready, just follow these steps, and if you have any questions or need help, don’t hesitate to ask. Thanks.

1 Like

Hi @Ali, This is my first PR submission, and I’m really excited! However, I’m not very familiar with the code, so I kindly ask for your help in reviewing it. I hope to see similar functionality appear in Gibbon.

1 Like