module automation_students.send_feedback#

Short summary#

module ensae_teaching_cs.automation_students.send_feedback

Some automation helpers to grab mails from students about projects.

source on GitHub

Functions#

function

truncated documentation

enumerate_feedback

Sends feedback to students.

enumerate_send_email

Sends feedback to students. Sets mailbox to None to see what the first mail looks like before going through the …

Documentation#

Some automation helpers to grab mails from students about projects.

source on GitHub

ensae_teaching_cs.automation_students.send_feedback.enumerate_feedback(df1, col_group='Groupe', col_mail='Mail', col_name='Name', cols=['Sujet', 'Rapport', 'Code', 'Soutenance'], subject=None, begin=None, end=None, template='\n<p>{{ begin }}</p>\n<p><b>{{ col_name }}</b></p>\n<p>{{ name }}</p>\n{{ content }}\n<p>{{ end }}</p>\n', template_col='<p><b>{{ key }}</b></p><p>{{ value }}</p>\n', engine='jinja2', exc=True, fLOG=<function noLOG>)#

Sends feedback to students.

Paramètres:
  • df1 – dataframe

  • col_group – name of the column which contains the group definition

  • col_mail – name of the column which contains the mail of the members

  • col_name – name of the column which contains the names of the members

  • cols – list of columns to add to the mails, if there are multiple values per group, they will be joined by space or another separator if an element in this list is a tuple (col_name, sep)

  • subject – subject of the mail

  • begin – beginning of the mail

  • end – end of the mail (signature)

  • template – template of the mail

  • template_col – template for additional columns, the outcome will be joined to fill {{ content }} in the other template

  • engine – engine for the template

  • exc – raise an exception if there is no mail

Renvoie:

enumerate mails content as tuple (mail, html, text)

Example of dataframe containing feedback:

Mail

Name

Groupe

Sujet

Pitch

Code

AAA bbb

1

ABA ccc

1

jeu de hex

ok

ok

VVV uuu

2

ZZZZ xxxx

2

élections US, twitter, nuages de mots

ok

ok

GGG ffff

3

distribution des sièges dans un avion

ok

Les print peuvent être remplacés par une autre fonction afin de désactiver les print qui ne servent qu’à la mise au point.

??

31

RRRR yyyy

31

analyse de texte / nuage de mots

Il faut éviter le code dans le contenu du pitch. Le pitch est un peu flou quant aux raisons qui vous poussent à développer votre propre tokenizer. A bien justifier avant de vous lancer dans ce type de travail et ne pas oublier la question de son évaluation.

L’interface graphique est-elle indispensable ? Le code alterne fonction, lecture de texte. N’hésitez pas à séparer les deux pour le rendu final.

source on GitHub

ensae_teaching_cs.automation_students.send_feedback.enumerate_send_email(mailbox, subject, fr, df1, cc=None, delay=(1000, 1500), delay_sending=False, exc=True, skip=0, only=None, **params)#

Sends feedback to students. Sets mailbox to None to see what the first mail looks like before going through the whole list.

Paramètres:
  • mailbox – mailbox, see create_smtp_server, if mailbox is None, the function displays the message and fails

  • subject – subject

  • fr – from

  • df1 – first dataframe

  • cc – additional receivers

  • delay – random delay between two mails

  • delay_sending – returns functions

  • exc – raise exception when mail is empty

  • skip – skip the first mails

  • only – send only to these groups (group id)

  • params – see enumerate_feedback

Renvoie:

enumerate mails

Short example (see algo Send many mails):

import pandas
import sys
import os

cc = ["cc@cc.org"]
sujet = "Projet informatique, feedback sur le pitch"
only = None # {28, 20, 19}

from pyquickhelper.loghelper import fLOG
fLOG(OutputPrint=True)

from ensae_teaching_cs.automation_students import enumerate_feedback, enumerate_send_email
import pymmails

df = pandas.read_excel("groupes_eleves_pitch.xlsx", sheet_name=0, engine='openpyxl')

mailbox = pymmails.sender.create_smtp_server("gmail", "xavier.dupre", "****")
mails = enumerate_send_email(mailbox, sujet, "xavier.dupre@gmail.com",
              df, exc=True, fLOG=fLOG, delay_sending=False,
              begin=begin, end=end,
              cc=cc, only=only, col_group="Groupe",
              col_name="Nom", col_mail="Mail",
              cols=["Sujet", "Rapport", "Code", "Soutenance", "Question code",
                    "Note rapport / 5", "Note code / 7", "Note soutenance / 5",
                    "Suivi  et Bonus / 3 ou 4", "Bonus raison"])
mailbox.close()

source on GitHub