{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": true }, "outputs": [], "source": [ "import xlsxwriter\n", "import sqlite3\n", "import pandas as pd\n", "import numpy as np\n", "from math import ceil\n", "import seaborn as sns\n", "import matplotlib.pyplot as plt\n", "%matplotlib inline\n", "from pprint import pprint" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": true }, "outputs": [], "source": [ "from repytex.tools.evaluation import Evaluation\n", "from repytex.tools.sqlite_getters import all_ev_description" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Récupération de la structure du DNB blanc" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": true }, "outputs": [], "source": [ "conn = sqlite3.connect('../recopytex.db')" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "ev = Evaluation.from_sqlite(20, conn)" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
idnametermt_id
020DNB blanc122
\n", "
" ], "text/plain": [ " id name term t_id\n", "0 20 DNB blanc1 2 2" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ev.ev_df" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
idnamegrade
023063e
\n", "
" ], "text/plain": [ " id name grade\n", "0 2 306 3e" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ev.t_df" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
idnamesurnamemailcommmenttribe_id
027ABDALLAHRachmaNone2
128ABDOUKassimNone2
229AHAMADIIrchadiNone2
330AHAMEDMikidadiNone2
431ANLIEl AnzizNone2
\n", "
" ], "text/plain": [ " id name surname mail commment tribe_id\n", "0 27 ABDALLAH Rachma None 2\n", "1 28 ABDOU Kassim None 2\n", "2 29 AHAMADI Irchadi None 2\n", "3 30 AHAMED Mikidadi None 2\n", "4 31 ANLI El Anziz None 2" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ev.s_df.head()" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
idnameeval_iddatecomment
0581 Dalle de béton202018-02-07 00:00:00.000000
1592 Soirée Basket202018-02-07 00:00:00.000000
2603 Recette de gateau202018-02-07 00:00:00.000000
3614 Dessiner une figure202018-02-07 00:00:00.000000
4625 Cross du collège202018-02-07 00:00:00.000000
\n", "
" ], "text/plain": [ " id name eval_id date comment\n", "0 58 1 Dalle de béton 20 2018-02-07 00:00:00.000000 \n", "1 59 2 Soirée Basket 20 2018-02-07 00:00:00.000000 \n", "2 60 3 Recette de gateau 20 2018-02-07 00:00:00.000000 \n", "3 61 4 Dessiner une figure 20 2018-02-07 00:00:00.000000 \n", "4 62 5 Cross du collège 20 2018-02-07 00:00:00.000000 " ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ev.ex_df.head()" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
idquestion_idstudent_idvalue
\n", "
" ], "text/plain": [ "Empty DataFrame\n", "Columns: [id, question_id, student_id, value]\n", "Index: []" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ev.sc_df.head()" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Evaluation DNB blanc1 306 - T2\n", "Ex 1 Dalle de béton\n", "\tQu 1: Multiplications total HT (3, Cal)\n", "\tQu 1: Division quantité (2, Cal)\n", "\tQu 1: Somme Total HT et TC (4, Cal)\n", "\tQu 2 a et b: Lecture de tableur (4, Rep)\n", "\tQu 2 c et d: Formule tableur (4, Rep)\n", "Ex 2 Soirée Basket\n", "\tQu 1 à 3: Lire un tableau (6, Cher)\n", "\tQu 4 à 5: Calculs de points (6, Mod)\n", "\tQu 6: Paniers à 2 points (4, Rai)\n", "\tQu 7: Champion de la soirée (3, Rai)\n", "Ex 3 Recette de gateau\n", "\tQu 1: Multiplier les quantités (3, Mod)\n", "\tQu 1: Rapport 3 (3, Mod)\n", "\tQu 1: Multiplication de la fraction (1, Mod)\n", "\tQu 2: Quantité restante (2, Cal)\n", "\tQu 2: Fractions (2, Cal)\n", "Ex 4 Dessiner une figure\n", "\tQu 1: Dessin du lutin (3, Rep)\n", "\tQu 2: Modifications (6, Rep)\n", "Ex 5 Cross du collège\n", "\tQu 1 et 2: Calculs de longueur (6, Rep)\n", "\tQu 3: Pythagore (5, Mod)\n", "\tQu 4: Longueur d'un tour (5, Mod)\n", "\tQu 5: Longueur pour les 3e (4, Cal)\n", "Ex 6 Voyage en famille\n", "\tQu 1: Calcul temps et conversion demi heure (4, Cal)\n", "\tQu 2: Lectures graphiques (6, Rep)\n", "\tQu 3: Véracité de l'affirmation (4, Rai)\n", "Ex Présentation\n", "\tQu : (10, Com)\n", "\n" ] } ], "source": [ "print(ev.description())" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "## Construction des df à partir du tableur pour les 306" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "collapsed": true }, "outputs": [], "source": [ "ev_df = ev.ev_df" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [], "source": [ "ex_df = ev.ex_df" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "collapsed": true }, "outputs": [], "source": [ "q_df = ev.q_df" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "collapsed": true }, "outputs": [], "source": [ "t_df = ev.t_df" ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "collapsed": true }, "outputs": [], "source": [ "s_df = ev.s_df" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Extraction des scores" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [], "source": [ "excelname = './306-DNB blanc1-pro.xlsx'" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [], "source": [ "xls_df = pd.read_excel(excelname).T" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PrésentationEx 1 Dalle de béton0 - Multiplications total HT1 - Division quantité2 - Somme Total HT et TC3 - Lecture de tableur4 - Formule tableurEx 2 Soirée Basket0 - Lire un tableau1 - Calculs de points...1 - ModificationsEx 5 Cross du collège0 - Calculs de longueur1 - Pythagore2 - Longueur d'un tour3 - Longueur pour les 3eEx 6 Voyage en famille0 - Calcul temps et conversion demi heure1 - Lectures graphiques2 - Véracité de l'affirmation
CompetenceNaNNaNCalCalCalRepRepNaNCherMod...RepNaNRepModModCalNaNCalRepRai
Barème1017324441966...620655414464
Ousseni Fayadhui10000000000...0000000000
BOINA Chadia91022042000...0000000000
MAGNELE Chamsidine91332440110...0000000000
\n", "

5 rows × 30 columns

\n", "
" ], "text/plain": [ " Présentation Ex 1 Dalle de béton \\\n", "Competence NaN NaN \n", "Barème 10 17 \n", "Ousseni Fayadhui 10 0 \n", "BOINA Chadia 9 10 \n", "MAGNELE Chamsidine 9 13 \n", "\n", " 0 - Multiplications total HT 1 - Division quantité \\\n", "Competence Cal Cal \n", "Barème 3 2 \n", "Ousseni Fayadhui 0 0 \n", "BOINA Chadia 2 2 \n", "MAGNELE Chamsidine 3 2 \n", "\n", " 2 - Somme Total HT et TC 3 - Lecture de tableur \\\n", "Competence Cal Rep \n", "Barème 4 4 \n", "Ousseni Fayadhui 0 0 \n", "BOINA Chadia 0 4 \n", "MAGNELE Chamsidine 4 4 \n", "\n", " 4 - Formule tableur Ex 2 Soirée Basket 0 - Lire un tableau \\\n", "Competence Rep NaN Cher \n", "Barème 4 19 6 \n", "Ousseni Fayadhui 0 0 0 \n", "BOINA Chadia 2 0 0 \n", "MAGNELE Chamsidine 0 1 1 \n", "\n", " 1 - Calculs de points ... \\\n", "Competence Mod ... \n", "Barème 6 ... \n", "Ousseni Fayadhui 0 ... \n", "BOINA Chadia 0 ... \n", "MAGNELE Chamsidine 0 ... \n", "\n", " 1 - Modifications Ex 5 Cross du collège \\\n", "Competence Rep NaN \n", "Barème 6 20 \n", "Ousseni Fayadhui 0 0 \n", "BOINA Chadia 0 0 \n", "MAGNELE Chamsidine 0 0 \n", "\n", " 0 - Calculs de longueur 1 - Pythagore \\\n", "Competence Rep Mod \n", "Barème 6 5 \n", "Ousseni Fayadhui 0 0 \n", "BOINA Chadia 0 0 \n", "MAGNELE Chamsidine 0 0 \n", "\n", " 2 - Longueur d'un tour 3 - Longueur pour les 3e \\\n", "Competence Mod Cal \n", "Barème 5 4 \n", "Ousseni Fayadhui 0 0 \n", "BOINA Chadia 0 0 \n", "MAGNELE Chamsidine 0 0 \n", "\n", " Ex 6 Voyage en famille \\\n", "Competence NaN \n", "Barème 14 \n", "Ousseni Fayadhui 0 \n", "BOINA Chadia 0 \n", "MAGNELE Chamsidine 0 \n", "\n", " 0 - Calcul temps et conversion demi heure \\\n", "Competence Cal \n", "Barème 4 \n", "Ousseni Fayadhui 0 \n", "BOINA Chadia 0 \n", "MAGNELE Chamsidine 0 \n", "\n", " 1 - Lectures graphiques 2 - Véracité de l'affirmation \n", "Competence Rep Rai \n", "Barème 6 4 \n", "Ousseni Fayadhui 0 0 \n", "BOINA Chadia 0 0 \n", "MAGNELE Chamsidine 0 0 \n", "\n", "[5 rows x 30 columns]" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "xls_df = xls_df.drop(\"DNB blanc1\", axis = 1)\n", "xls_df.head()" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Présentation0 - Multiplications total HT1 - Division quantité2 - Somme Total HT et TC3 - Lecture de tableur4 - Formule tableur0 - Lire un tableau1 - Calculs de points2 - Paniers à 2 points3 - Champion de la soirée...4 - Fractions0 - Dessin du lutin1 - Modifications0 - Calculs de longueur1 - Pythagore2 - Longueur d'un tour3 - Longueur pour les 3e0 - Calcul temps et conversion demi heure1 - Lectures graphiques2 - Véracité de l'affirmation
CompetenceNaNCalCalCalRepRepCherModRaiRai...CalRepRepRepModModCalCalRepRai
Barème10324446643...2366554464
Ousseni Fayadhui10000000000...0000000000
BOINA Chadia9220420000...0000000000
MAGNELE Chamsidine9324401000...0000000000
\n", "

5 rows × 24 columns

\n", "
" ], "text/plain": [ " Présentation 0 - Multiplications total HT \\\n", "Competence NaN Cal \n", "Barème 10 3 \n", "Ousseni Fayadhui 10 0 \n", "BOINA Chadia 9 2 \n", "MAGNELE Chamsidine 9 3 \n", "\n", " 1 - Division quantité 2 - Somme Total HT et TC \\\n", "Competence Cal Cal \n", "Barème 2 4 \n", "Ousseni Fayadhui 0 0 \n", "BOINA Chadia 2 0 \n", "MAGNELE Chamsidine 2 4 \n", "\n", " 3 - Lecture de tableur 4 - Formule tableur \\\n", "Competence Rep Rep \n", "Barème 4 4 \n", "Ousseni Fayadhui 0 0 \n", "BOINA Chadia 4 2 \n", "MAGNELE Chamsidine 4 0 \n", "\n", " 0 - Lire un tableau 1 - Calculs de points \\\n", "Competence Cher Mod \n", "Barème 6 6 \n", "Ousseni Fayadhui 0 0 \n", "BOINA Chadia 0 0 \n", "MAGNELE Chamsidine 1 0 \n", "\n", " 2 - Paniers à 2 points 3 - Champion de la soirée \\\n", "Competence Rai Rai \n", "Barème 4 3 \n", "Ousseni Fayadhui 0 0 \n", "BOINA Chadia 0 0 \n", "MAGNELE Chamsidine 0 0 \n", "\n", " ... 4 - Fractions \\\n", "Competence ... Cal \n", "Barème ... 2 \n", "Ousseni Fayadhui ... 0 \n", "BOINA Chadia ... 0 \n", "MAGNELE Chamsidine ... 0 \n", "\n", " 0 - Dessin du lutin 1 - Modifications \\\n", "Competence Rep Rep \n", "Barème 3 6 \n", "Ousseni Fayadhui 0 0 \n", "BOINA Chadia 0 0 \n", "MAGNELE Chamsidine 0 0 \n", "\n", " 0 - Calculs de longueur 1 - Pythagore \\\n", "Competence Rep Mod \n", "Barème 6 5 \n", "Ousseni Fayadhui 0 0 \n", "BOINA Chadia 0 0 \n", "MAGNELE Chamsidine 0 0 \n", "\n", " 2 - Longueur d'un tour 3 - Longueur pour les 3e \\\n", "Competence Mod Cal \n", "Barème 5 4 \n", "Ousseni Fayadhui 0 0 \n", "BOINA Chadia 0 0 \n", "MAGNELE Chamsidine 0 0 \n", "\n", " 0 - Calcul temps et conversion demi heure \\\n", "Competence Cal \n", "Barème 4 \n", "Ousseni Fayadhui 0 \n", "BOINA Chadia 0 \n", "MAGNELE Chamsidine 0 \n", "\n", " 1 - Lectures graphiques 2 - Véracité de l'affirmation \n", "Competence Rep Rai \n", "Barème 6 4 \n", "Ousseni Fayadhui 0 0 \n", "BOINA Chadia 0 0 \n", "MAGNELE Chamsidine 0 0 \n", "\n", "[5 rows x 24 columns]" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ex_cols = [c for c in xls_df.columns if 'Ex' in c]\n", "xls_df = xls_df.drop(ex_cols, axis=1)\n", "xls_df.head()" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [], "source": [ "cols = {}\n", "for c in xls_df.columns:\n", " a = q_df[q_df['comment']==c.split(' - ')[-1]]\n", " try:\n", " cols[c] = a.id.values[0]\n", " except IndexError:\n", " # id de la question de présentation\n", " cols[c] = 278\n", "#cols" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
278178179180181182183184185186...191192193194195196197198199200
Ousseni Fayadhui10000000000...0000000000
BOINA Chadia9220420000...0000000000
MAGNELE Chamsidine9324401000...0000000000
MBAROUKOU Dania10222445643...0006001000
TSIMPOU Zoubert10000000000...0000000000
\n", "

5 rows × 24 columns

\n", "
" ], "text/plain": [ " 278 178 179 180 181 182 183 184 185 186 ... 191 192 193 \\\n", "Ousseni Fayadhui 10 0 0 0 0 0 0 0 0 0 ... 0 0 0 \n", "BOINA Chadia 9 2 2 0 4 2 0 0 0 0 ... 0 0 0 \n", "MAGNELE Chamsidine 9 3 2 4 4 0 1 0 0 0 ... 0 0 0 \n", "MBAROUKOU Dania 10 2 2 2 4 4 5 6 4 3 ... 0 0 0 \n", "TSIMPOU Zoubert 10 0 0 0 0 0 0 0 0 0 ... 0 0 0 \n", "\n", " 194 195 196 197 198 199 200 \n", "Ousseni Fayadhui 0 0 0 0 0 0 0 \n", "BOINA Chadia 0 0 0 0 0 0 0 \n", "MAGNELE Chamsidine 0 0 0 0 0 0 0 \n", "MBAROUKOU Dania 6 0 0 1 0 0 0 \n", "TSIMPOU Zoubert 0 0 0 0 0 0 0 \n", "\n", "[5 rows x 24 columns]" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "xls_df = xls_df.rename(columns=cols).drop([\"Competence\", 'Barème'])\n", "xls_df.head()" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [], "source": [ "studs = {}\n", "for s in xls_df.index:\n", " ss = s_df[s_df['surname'].str.contains(s.split(' ')[-1], case=False)]\n", " ss = ss.id.values\n", " studs[s] = ss[0]\n", "#studs" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
278178179180181182183184185186...191192193194195196197198199200
4210000000000...0000000000
349220420000...0000000000
389324401000...0000000000
3910222445643...0006001000
4610000000000...0000000000
\n", "

5 rows × 24 columns

\n", "
" ], "text/plain": [ " 278 178 179 180 181 182 183 184 185 186 ... 191 192 193 194 195 196 197 \\\n", "42 10 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 \n", "34 9 2 2 0 4 2 0 0 0 0 ... 0 0 0 0 0 0 0 \n", "38 9 3 2 4 4 0 1 0 0 0 ... 0 0 0 0 0 0 0 \n", "39 10 2 2 2 4 4 5 6 4 3 ... 0 0 0 6 0 0 1 \n", "46 10 0 0 0 0 0 0 0 0 0 ... 0 0 0 0 0 0 0 \n", "\n", " 198 199 200 \n", "42 0 0 0 \n", "34 0 0 0 \n", "38 0 0 0 \n", "39 0 0 0 \n", "46 0 0 0 \n", "\n", "[5 rows x 24 columns]" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "xls_df = xls_df.rename(index=studs)\n", "xls_df.head()" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "42 278 10\n", " 178 0\n", " 179 0\n", " 180 0\n", " 181 0\n", "dtype: object" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "xls_df = xls_df.stack()\n", "xls_df.head()" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
student_idquestion_idmark
04227810
1421780
2421790
3421800
4421810
\n", "
" ], "text/plain": [ " student_id question_id mark\n", "0 42 278 10\n", "1 42 178 0\n", "2 42 179 0\n", "3 42 180 0\n", "4 42 181 0" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sc_df = xls_df.reset_index().rename(columns={\"level_0\": \"student_id\", \"level_1\": \"question_id\", 0:'mark'})\n", "sc_df.head()" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
student_idquestion_idmark
04227810
1421780
2421790
3421800
4421810
\n", "
" ], "text/plain": [ " student_id question_id mark\n", "0 42 278 10\n", "1 42 178 0\n", "2 42 179 0\n", "3 42 180 0\n", "4 42 181 0" ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sc_df[\"mark\"] = sc_df[\"mark\"].astype(int)\n", "sc_df.head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Maintenant il faut transformer tout ça en niveau de compétence" ] }, { "cell_type": "code", "execution_count": 27, "metadata": { "collapsed": true }, "outputs": [], "source": [ "from repytex.tools.sc_transforms import mark2level\n", "def mark2level_row(x):\n", " return mark2level(x[\"mark\"], x[\"score_rate\"])" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
student_idquestion_idmarkidnamescore_rateis_leveledexercise_idcompetencedomaincomment
0422781027810186ComPrésentation
134278927810186ComPrésentation
238278927810186ComPrésentation
3392781027810186ComPrésentation
4462781027810186ComPrésentation
\n", "
" ], "text/plain": [ " student_id question_id mark id name score_rate is_leveled \\\n", "0 42 278 10 278 10 1 \n", "1 34 278 9 278 10 1 \n", "2 38 278 9 278 10 1 \n", "3 39 278 10 278 10 1 \n", "4 46 278 10 278 10 1 \n", "\n", " exercise_id competence domain comment \n", "0 86 Com Présentation \n", "1 86 Com Présentation \n", "2 86 Com Présentation \n", "3 86 Com Présentation \n", "4 86 Com Présentation " ] }, "execution_count": 28, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sc_q_df = pd.merge(sc_df, q_df, left_on=\"question_id\", right_on=\"id\")\n", "sc_q_df.head()" ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [], "source": [ "sc_q_df[\"value\"] = sc_q_df.apply(mark2level_row, axis=1)\n", "sc_q_df = sc_q_df[['student_id', 'question_id', 'value']]" ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [], "source": [ "sc_df = pd.merge(sc_df, sc_q_df, on=[\"student_id\", 'question_id'])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "On met tout ensemble dans l'évaluation" ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [], "source": [ "dnbBlanc = Evaluation(ev_df, t_df, s_df, ex_df)\n", "dnbBlanc.set_scores(sc_df)\n", "dnbBlanc.set_ex_qu_structure(ex_df, q_df)\n", "dnbBlanc.set_competence_assessment(sc_df, q_df)\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exploration" ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
student_idquestion_idmarkvalueidnamesurnamemailcommmenttribe_id
04227810342OUSSENIFayadhuiNone2
1421780042OUSSENIFayadhuiNone2
2421790042OUSSENIFayadhuiNone2
3421800042OUSSENIFayadhuiNone2
4421810042OUSSENIFayadhuiNone2
\n", "
" ], "text/plain": [ " student_id question_id mark value id name surname mail commment \\\n", "0 42 278 10 3 42 OUSSENI Fayadhui None \n", "1 42 178 0 0 42 OUSSENI Fayadhui None \n", "2 42 179 0 0 42 OUSSENI Fayadhui None \n", "3 42 180 0 0 42 OUSSENI Fayadhui None \n", "4 42 181 0 0 42 OUSSENI Fayadhui None \n", "\n", " tribe_id \n", "0 2 \n", "1 2 \n", "2 2 \n", "3 2 \n", "4 2 " ] }, "execution_count": 32, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sc_s_df = pd.merge(dnbBlanc.sc_df, dnbBlanc.s_df, left_on='student_id', right_on='id')\n", "sc_s_df.head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A priori pas de soucis avec les sommes de points" ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "name surname \n", "ABDALLAH Rachma 22\n", "ABDOU Kassim 6\n", "AHAMADI Irchadi 42\n", "AHAMED Mikidadi 25\n", "ANSSURDINE Zaidou 10\n", "BACAR MOUSTADRANE Rakchat 13\n", "BOINA Chadia 19\n", "CHANFI Fayçoil 17\n", "CHARIF Djaël 71\n", "COMBO Doulka-Rynaini 25\n", "IBRAHIM, Izaki 10\n", "MAGNELE Chamsidine 24\n", "MBAROUKOU Dania 56\n", "MIRADJI Issoufi 68\n", "NIDHOIMI El-Fahar 51\n", "OUSSENI Fayadhui 10\n", "SAID OMAR Nadjoi 43\n", "SALIM Haïridine 10\n", "SAÏD Dalila 50\n", "Said Rachida 16\n", "TSIMPOU Zoubert 10\n", "Name: mark, dtype: int64" ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sc_s_df.groupby([\"name\", \"surname\"]).sum()['mark']" ] }, { "cell_type": "code", "execution_count": 34, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
student_idquestion_idmarkvalueid_xname_xsurnamemailcommmenttribe_idid_yname_yscore_rateis_leveledexercise_idcompetencedomaincomment
04227810342OUSSENIFayadhuiNone227810186ComPrésentation
1342789334BOINAChadiaNone227810186ComPrésentation
2382789338MAGNELEChamsidineNone227810186ComPrésentation
33927810339MBAROUKOUDaniaNone227810186ComPrésentation
44627810346TSIMPOUZoubertNone227810186ComPrésentation
\n", "
" ], "text/plain": [ " student_id question_id mark value id_x name_x surname mail \\\n", "0 42 278 10 3 42 OUSSENI Fayadhui \n", "1 34 278 9 3 34 BOINA Chadia \n", "2 38 278 9 3 38 MAGNELE Chamsidine \n", "3 39 278 10 3 39 MBAROUKOU Dania \n", "4 46 278 10 3 46 TSIMPOU Zoubert \n", "\n", " commment tribe_id id_y name_y score_rate is_leveled exercise_id \\\n", "0 None 2 278 10 1 86 \n", "1 None 2 278 10 1 86 \n", "2 None 2 278 10 1 86 \n", "3 None 2 278 10 1 86 \n", "4 None 2 278 10 1 86 \n", "\n", " competence domain comment \n", "0 Com Présentation \n", "1 Com Présentation \n", "2 Com Présentation \n", "3 Com Présentation \n", "4 Com Présentation " ] }, "execution_count": 34, "metadata": {}, "output_type": "execute_result" } ], "source": [ "full_df = pd.merge(dnbBlanc.sc_df, dnbBlanc.s_df, left_on=\"student_id\", right_on=\"id\")\n", "full_df = pd.merge(full_df, dnbBlanc.q_df, left_on=\"question_id\", right_on=\"id\")\n", "full_df.head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## On compile?" ] }, { "cell_type": "code", "execution_count": 36, "metadata": { "collapsed": true }, "outputs": [], "source": [ "from repytex.reports.eval_reports import build_target_name\n", "from repytex.reports.produce_compile import produce_compile" ] }, { "cell_type": "code", "execution_count": 37, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Path('.//306/report_DNB blanc 1.tex')" ] }, "execution_count": 37, "metadata": {}, "output_type": "execute_result" } ], "source": [ "datas = {\"evaluation\": dnbBlanc}\n", "target = build_target_name('306', 'DNB blanc 1')\n", "target" ] }, { "cell_type": "code", "execution_count": 38, "metadata": { "collapsed": true }, "outputs": [], "source": [ "template=\"tpl_reports_eval.tex\"" ] }, { "cell_type": "code", "execution_count": 39, "metadata": {}, "outputs": [], "source": [ "produce_compile(template, datas, target, force=1)" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.4" } }, "nbformat": 4, "nbformat_minor": 2 }