#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2005
    Posts
    1
    Rep Power
    0

    School Python Grade Script


    I want to ask for some help from advanced 'coding' ppl in this forum. It is for a project i'm doing at school s otaht teachers can type in a student name, and then something like 'good, fair, poor, etc'. and then a paragraph is created using something like this:
    '
    Enter Name: Bob
    Enter Level: Fair

    (weird processes and what not)

    Bob has done some nice work this semester, and will need to work harder to achieve a better grade next semester.

    '

    So basically i want the name to set to a value so that a premade paragraph can use the name value instead of 'name'. and i also want to be able to have fair, good, etc to link to a different paragraph. so its like a fast way for teachers to write comments on a computer even though it isnt personalized.

    Can anyone help?
    I would be very greatful

    thx,

    aperv
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2004
    Posts
    394
    Rep Power
    52
    Hi!

    Code:
    levels = {
        'good': "%s has done nice work this semester.",
        'bad': "%s is an idiot."
    }
    
    while 1:
        name = raw_input("Enter Name: ")
        level = raw_input("Enter Level: ")
        print levels[level] % name
    Regards, mawe
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Posts
    624
    Rep Power
    35
    I'm going to guess the teacher has the student list and grading already in a file somewhere.

    Please, if this is the case, work it so they don't have to type anything at all... This would be easy as an excel formula, or a Python script if it's comma-delimited, or many other ways...
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2004
    Location
    There where the rabbits jump
    Posts
    556
    Rep Power
    12
    could you please be alittle more clear
    I understand you want a grading program
    but for what it is quite complicated. I wrote one to if you wanna look at it
    Attached Files

IMN logo majestic logo threadwatch logo seochat tools logo