Exemple #1
0
def show_all_students(school_class):
    all_student_names = []
    school_class.sort_students()
    for student in school_class.students:
        all_student_names.append(student.get_full_name())

    view.get_list(all_student_names)
Exemple #2
0
def main_menu():
    school = School.create_from_csv('school.csv')

    user_choice = None
    while user_choice != 0:
        view.print_main_menu()
        user_choice = view.get_user_input()

        if user_choice == 1:
            view.get_list(school.get_all_teachers())

        elif user_choice == 2:
            print(school.get_best_class())

        elif user_choice == 3:
            choose_class(school)

        elif user_choice == 4:
            new_class = add_class(school)
            class_controller.class_menu(new_class)

        elif user_choice == 5:
            school.save_to_file()

    view.print_exit_message()
Exemple #3
0
def class_menu(school_class):
    user_choice = ''
    while user_choice != 0:
        view.print_class_menu()
        user_choice = view.get_user_input()

        if user_choice == 1:
            print(school_class.get_best_student())

        elif user_choice == 2:
            print(school_class.get_average_grade())

        elif user_choice == 3:
            view.get_list(school_class.get_class_subjects())

        elif user_choice == 4:
            add_teacher(school_class)

        elif user_choice == 5:
            remove_teacher(school_class)

        elif user_choice == 6:
            add_student(school_class)

        elif user_choice == 7:
            remove_student(school_class)

        elif user_choice == 8:
            show_all_students(school_class)

        elif user_choice == 9:
            show_teachers(school_class)

        elif user_choice == 10:
            choose_student(school_class)

        elif user_choice == 11:
            # choose teacher
            pass
Exemple #4
0
            <input type="submit" value="delete">
        </form>
    """.format(pageId)
else:
    title = pageId = 'Welcome'
    description = 'Hello, web'
    update_link = ''
    delete_action = ''
print("""<!doctype html>
<html>
<head>
  <title>WEB1 - html</title>
  <meta charset="utf-8">
</head>
<body>
  <h1><a href="index.py">WEB</a></h1>
  <ol>
    {str_lst}
  </ol>
  <a href="create.py">create</a>
  {update_link}
  {delete_action}
  <h2>{title}</h2>
  <p>{desc}<p>
<body>
</html>
""".format(title=title,
           desc=description,
           str_lst=view.get_list(),
           update_link=update_link,
           delete_action=delete_action))
Exemple #5
0
print('''<!doctype html>
<html>
<head>
  <title>WEB1 - Welcome</title>
  <meta charset="utf-8">
</head>
<body>
<button class="button button2" onclick="location.href='Python.html'">Go Back</button>
  <h1><a href="Python.py">WEB</a></h1>
  <ol>
    {liststr}
  </ol>
  <p><a href="Create.py">Create</a></p>
  <form action="Process_Update.py" method="post">
  <fieldset style = "width:300px; height:500px;">
  <legend>Information You Create</legend>
  <input type="hidden" name="pageId" value="{form_default_title}"
  Title : <p><input type="text" name="title" placeholder="title" value="{form_default_title}"></p>
  Description : <p><textarea rows="4"style="overflow:visible;" name="description"
  placeholder="description">{form_default_description}</textarea></p>
  <input type = "submit" value = "submit"/>
  <input type = "reset" value = "reset"/><br><br>
  </fieldset>
</body>
</html>
'''.format(title=pageId,
           liststr=view.get_list(),
           description=description,
           form_default_title=pageId,
           form_default_description=description))
Exemple #6
0
</head>
<body style="background-image: url('background.png'); font-family:verdana;">
  <div style="text-align:center;">
  <h1><a href="index.py">TrekkPedia NZ</a></h1>
    <picture>
      <sourse srcset="mains.png" media="(min-width:1024px)">
      <sourse srcset="mains.png" media="(min-width:768px)">
      <sourse srcset="mains.png" media="(min-width:320px)">
      <img src="mains.png" alt="New Zealand's trekking courses" alt="TrekkPedia" style="width:100%;">
    </picture>
    <br>
  <h2>How was your fascinating trekking course!?</h2>
  <form action="process_create.py" method="post">
      <p><input type="text" name="title" placeholder="Course name?"></p>
      <p><textarea rows="5" name="description" placeholder="Can you write a description of the trekking course as detail as you can?"></textarea></p>
      <p><input type="submit" onclick="alert('If it is appropriate info, it is going to be helpful to trekkers')"></p>
  </form>
  <p><b style="color:red;">(Tip)</b> You can use <strong style="color:DodgerBlue;">'Ctrl+F'</strong> for searching what you want to find certain trekking courses..</p>
  </div>
  <ul>
    {liststr}
  </ul>
</body>
<footer style="text-align:center;">
  <hr align="center" width="100%">
  <p>Written by Joo-Hyun Ahn | for COSC480 Project | MADS of UC 2019</p>
  <p>Contact information: <a href="mailto:[email protected]">[email protected]</a>, +64) 021 654 780</p>
</footer>
</html>
'''.format(title=pageid, desc=description, liststr=view.get_list()))
Exemple #7
0
def show_teachers(school_class):
    all_teacher_names = []
    for teacher in school_class.teachers:
        all_teacher_names.append(teacher.get_full_name())

    view.get_list(all_teacher_names)
Exemple #8
0
def choose_class(school):
    view.get_list(show_all_classes(school))
    class_name = view.get_class_name()
    for school_class in school.classes:
        if class_name.lower() == school_class.name:
            class_controller.class_menu(school_class)
Exemple #9
0
def show_all_items(todo_list):
    view.get_list(todo_list.list_of_items)
Exemple #10
0
    with open('Data/' + pageId, 'r') as file:
        description = file.read()
else:
    pageId = 'Welcome'
    description = 'Hello, web'
print('''<!doctype html>
<html>
<head>
  <title>WEB1 - Welcome</title>
  <meta charset="utf-8">
</head>
<body>
<button class="button button2" onclick="location.href='Python.html'">Go Back</button>
  <h1><a href="Python.py">WEB</a></h1>
  <ol>
    {liststr}
  </ol>
  <p><a href="Create.py">Create</a></p>
  <form action="Process_Create.py" method="post">
  <fieldset style = "width:300px; height:500px;">
  <legend>Information You Create</legend>
  Title : <p><input type="text" name="title" placeholder="title"></p>
  Description : <p><textarea rows="4"style="overflow:visible;" name="description"
  placeholder="description"></textarea></p>
  <input type = "submit" value = "submit"/>
  <input type = "reset" value = "reset"/><br><br>
  </fieldset>
</body>
</html>
'''.format(title=pageId, liststr=view.get_list(), description=description))
Exemple #11
0
print("Content-Type: text/html")
print()
form = cgi.FieldStorage()
if 'id' in form:
    pageId = form["id"].value
    description = open('data/'+pageId, 'r').read()
else:
    pageId = 'Welcome'
    description = 'Hello, web'
print("""<!doctype html>
<html>
<head>
  <title>WEB1 - html</title>
  <meta charset="utf-8">
</head>
<body>
  <h1><a href="index.py">WEB</a></h1>
  <ol>
    {str_lst}
  </ol>
  <a href="create.py">create</a>
  <form action="process_create.py" method="post">
      <p><input type="text" name="title" placeholder="title"></p>
      <p><textarea rows="4" name="description" placeholder="description"></textarea></p>
      <p><input type="submit"></p>
  </form>
<body>
</html>
""".format(title=pageId, desc=description, str_lst=view.get_list()))