{ "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": { "collapsed": true }, "outputs": [], "source": [ "ev = Evaluation.from_sqlite(21, 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
021DNB blanc121
\n", "
" ], "text/plain": [ " id name term t_id\n", "0 21 DNB blanc1 2 1" ] }, "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
013023e
\n", "
" ], "text/plain": [ " id name grade\n", "0 1 302 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
01ABDALLAH ALLAOUITaiassimaNone1
12ADANIIsmouNone1
23AHAMADADhoulkamalNone1
34AHAMADIAsbahatiNone1
45AHAMADI OUSSENIAnsufiddineNone1
\n", "
" ], "text/plain": [ " id name surname mail commment tribe_id\n", "0 1 ABDALLAH ALLAOUI Taiassima None 1\n", "1 2 ADANI Ismou None 1\n", "2 3 AHAMADA Dhoulkamal None 1\n", "3 4 AHAMADI Asbahati None 1\n", "4 5 AHAMADI OUSSENI Ansufiddine None 1" ] }, "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", " \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
0641 - QCM212018-02-07 00:00:00.000000
1652 - Boite de chocolat212018-02-07 00:00:00.000000
2663 - Scratch212018-02-07 00:00:00.000000
3674 - Programme de calcul212018-02-07 00:00:00.000000
4685 - Macaron212018-02-07 00:00:00.000000
5696 - Inspecteur212018-02-07 00:00:00.000000
6707 - La tache212018-02-07 00:00:00.000000
791Présentation212018-02-18 00:00:00.000000
\n", "
" ], "text/plain": [ " id name eval_id date comment\n", "0 64 1 - QCM 21 2018-02-07 00:00:00.000000 \n", "1 65 2 - Boite de chocolat 21 2018-02-07 00:00:00.000000 \n", "2 66 3 - Scratch 21 2018-02-07 00:00:00.000000 \n", "3 67 4 - Programme de calcul 21 2018-02-07 00:00:00.000000 \n", "4 68 5 - Macaron 21 2018-02-07 00:00:00.000000 \n", "5 69 6 - Inspecteur 21 2018-02-07 00:00:00.000000 \n", "6 70 7 - La tache 21 2018-02-07 00:00:00.000000 \n", "7 91 Présentation 21 2018-02-18 00:00:00.000000 " ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "ev.ex_df" ] }, { "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 302 - T2\n", "Ex 1 - QCM\n", "\tQu 1: QCM (2, Cal)\n", "\tQu 2: QCM (2, Cal)\n", "\tQu 3: QCM (2, Cal)\n", "\tQu 4: QCM (2, Rep)\n", "\tQu 5: QCM (2, Cal)\n", "Ex 2 - Boite de chocolat\n", "\tQu 1 à 3: Calcul proba (4, Rep)\n", "\tQu 2: Modification situation (3, Rai)\n", "\tQu 3: Nouvelle composition (3, Rai)\n", "Ex 3 - Scratch\n", "\tQu 1: Que fait le programme (3, Com)\n", "\tQu 2: Réponse à 13 (4, Rai)\n", "\tQu 3: Age pour conduire (3, Cher)\n", "Ex 4 - Programme de calcul\n", "\tQu 1: Application du calcul (5, Cal)\n", "\tQu 2: Renverser le calcul (4, Rai)\n", "\tQu 3: Appliquer à x et developper (6, Cal)\n", "Ex 5 - Macaron\n", "\tQu 1: Proportionnalité (3, Mod)\n", "\tQu 2 et 4: Lecture graphique (4, Rep)\n", "\tQu 3: Écart de température (4, Rep)\n", "\tQu 4: Satisfaction (4, Com)\n", "Ex 6 - Inspecteur\n", "\tQu 1: Hypothèses (2, Cher)\n", "\tQu 1: Reconnaissance des théorèmes (3, Mod)\n", "\tQu 1: Calculs dans les théorèmes (4, Cal)\n", "\tQu 1: Réponse à la question (3, Com)\n", "\tQu 2: Confiance au pilote (3, Rai)\n", "Ex 7 - La tache\n", "\tQu : Décomposition du problème (3, Cher)\n", "\tQu : Lecture des informations (4, Cher)\n", "\tQu : Calculs sensé (4, Cal)\n", "\tQu : Clarté des explications (4, Com)\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": { "collapsed": true }, "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": { "collapsed": true }, "outputs": [], "source": [ "excelname = './302_dnbblanc1.xls'" ] }, { "cell_type": "code", "execution_count": 17, "metadata": { "collapsed": true }, "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 - QCM0 - QCM1 - QCM2 - QCM3 - QCM4 - QCMEx 2 - Boite de chocolat0 - Calcul proba1 - Modification situation...0 - Hypothèses1 - Reconnaissance des théorèmes2 - Calculs dans les théorèmes3 - Réponse à la question4 - Confiance au piloteEx 7 - La tache0 - Décomposition du problème1 - Lecture des informations2 - Calculs sensé3 - Clarté des explications
CompetenceNaNNaNCalCalCalRepCalNaNRepRai...CherModCalComRaiNaNCherCherCalCom
Barème1010222221043...23433153444
ismou8420002000...0100041111
asbahati106202201043...00003133424
Hadaïta9602220743...02013113422
\n", "

5 rows × 35 columns

\n", "
" ], "text/plain": [ " Présentation Ex 1 - QCM 0 - QCM 1 - QCM 2 - QCM 3 - QCM 4 - QCM \\\n", "Competence NaN NaN Cal Cal Cal Rep Cal \n", "Barème 10 10 2 2 2 2 2 \n", "ismou 8 4 2 0 0 0 2 \n", "asbahati 10 6 2 0 2 2 0 \n", "Hadaïta 9 6 0 2 2 2 0 \n", "\n", " Ex 2 - Boite de chocolat 0 - Calcul proba \\\n", "Competence NaN Rep \n", "Barème 10 4 \n", "ismou 0 0 \n", "asbahati 10 4 \n", "Hadaïta 7 4 \n", "\n", " 1 - Modification situation ... \\\n", "Competence Rai ... \n", "Barème 3 ... \n", "ismou 0 ... \n", "asbahati 3 ... \n", "Hadaïta 3 ... \n", "\n", " 0 - Hypothèses 1 - Reconnaissance des théorèmes \\\n", "Competence Cher Mod \n", "Barème 2 3 \n", "ismou 0 1 \n", "asbahati 0 0 \n", "Hadaïta 0 2 \n", "\n", " 2 - Calculs dans les théorèmes 3 - Réponse à la question \\\n", "Competence Cal Com \n", "Barème 4 3 \n", "ismou 0 0 \n", "asbahati 0 0 \n", "Hadaïta 0 1 \n", "\n", " 4 - Confiance au pilote Ex 7 - La tache \\\n", "Competence Rai NaN \n", "Barème 3 15 \n", "ismou 0 4 \n", "asbahati 3 13 \n", "Hadaïta 3 11 \n", "\n", " 0 - Décomposition du problème 1 - Lecture des informations \\\n", "Competence Cher Cher \n", "Barème 3 4 \n", "ismou 1 1 \n", "asbahati 3 4 \n", "Hadaïta 3 4 \n", "\n", " 2 - Calculs sensé 3 - Clarté des explications \n", "Competence Cal Com \n", "Barème 4 4 \n", "ismou 1 1 \n", "asbahati 2 4 \n", "Hadaïta 2 2 \n", "\n", "[5 rows x 35 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 - QCM1 - QCM2 - QCM3 - QCM4 - QCM0 - Calcul proba1 - Modification situation2 - Nouvelle composition0 - Que fait le programme...3 - Satisfaction0 - Hypothèses1 - Reconnaissance des théorèmes2 - Calculs dans les théorèmes3 - Réponse à la question4 - Confiance au pilote0 - Décomposition du problème1 - Lecture des informations2 - Calculs sensé3 - Clarté des explications
CompetenceNaNCalCalCalRepCalRepRaiRaiCom...ComCherModCalComRaiCherCherCalCom
Barème10222224333...4234333444
ismou8200020002...4010001111
asbahati10202204333...4000033424
Hadaïta9022204303...4020133422
\n", "

5 rows × 28 columns

\n", "
" ], "text/plain": [ " Présentation 0 - QCM 1 - QCM 2 - QCM 3 - QCM 4 - QCM \\\n", "Competence NaN Cal Cal Cal Rep Cal \n", "Barème 10 2 2 2 2 2 \n", "ismou 8 2 0 0 0 2 \n", "asbahati 10 2 0 2 2 0 \n", "Hadaïta 9 0 2 2 2 0 \n", "\n", " 0 - Calcul proba 1 - Modification situation \\\n", "Competence Rep Rai \n", "Barème 4 3 \n", "ismou 0 0 \n", "asbahati 4 3 \n", "Hadaïta 4 3 \n", "\n", " 2 - Nouvelle composition 0 - Que fait le programme \\\n", "Competence Rai Com \n", "Barème 3 3 \n", "ismou 0 2 \n", "asbahati 3 3 \n", "Hadaïta 0 3 \n", "\n", " ... 3 - Satisfaction 0 - Hypothèses \\\n", "Competence ... Com Cher \n", "Barème ... 4 2 \n", "ismou ... 4 0 \n", "asbahati ... 4 0 \n", "Hadaïta ... 4 0 \n", "\n", " 1 - Reconnaissance des théorèmes 2 - Calculs dans les théorèmes \\\n", "Competence Mod Cal \n", "Barème 3 4 \n", "ismou 1 0 \n", "asbahati 0 0 \n", "Hadaïta 2 0 \n", "\n", " 3 - Réponse à la question 4 - Confiance au pilote \\\n", "Competence Com Rai \n", "Barème 3 3 \n", "ismou 0 0 \n", "asbahati 0 3 \n", "Hadaïta 1 3 \n", "\n", " 0 - Décomposition du problème 1 - Lecture des informations \\\n", "Competence Cher Cher \n", "Barème 3 4 \n", "ismou 1 1 \n", "asbahati 3 4 \n", "Hadaïta 3 4 \n", "\n", " 2 - Calculs sensé 3 - Clarté des explications \n", "Competence Cal Com \n", "Barème 4 4 \n", "ismou 1 1 \n", "asbahati 2 4 \n", "Hadaïta 2 2 \n", "\n", "[5 rows x 28 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": [ { "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
idnamescore_rateis_leveledexercise_idcompetencedomaincomment
020112164CalQCM
122422164CalQCM
222532164CalQCM
322642164RepQCM
422752164CalQCM
02021 à 34165RepProbaCalcul proba
120323165RaiProbaModification situation
220433165RaiProbaNouvelle composition
020513166ComScratchQue fait le programme
120624166RaiScratchRéponse à 13
220733166CherScratchAge pour conduire
020815167CalProgrammeApplication du calcul
120924167RaiProgrammeRenverser le calcul
221036167CalProgrammeAppliquer à x et developper
021113168ModProportionnelProportionnalité
12122 et 44168RepGraphiqueLecture graphique
221334168RepGraphiqueÉcart de température
321444168ComGraphiqueSatisfaction
021512169CherGéométrieHypothèses
121613169ModGéométrieReconnaissance des théorèmes
221714169CalGéométrieCalculs dans les théorèmes
321813169ComGéométrieRéponse à la question
421923169RaiGéométrieConfiance au pilote
02203170CherTCDécomposition du problème
12214170CherTCLecture des informations
22224170CalTCCalculs sensé
32234170ComTCClarté des explications
028910191ComPrésentation
\n", "
" ], "text/plain": [ " id name score_rate is_leveled exercise_id competence domain \\\n", "0 201 1 2 1 64 Cal \n", "1 224 2 2 1 64 Cal \n", "2 225 3 2 1 64 Cal \n", "3 226 4 2 1 64 Rep \n", "4 227 5 2 1 64 Cal \n", "0 202 1 à 3 4 1 65 Rep Proba \n", "1 203 2 3 1 65 Rai Proba \n", "2 204 3 3 1 65 Rai Proba \n", "0 205 1 3 1 66 Com Scratch \n", "1 206 2 4 1 66 Rai Scratch \n", "2 207 3 3 1 66 Cher Scratch \n", "0 208 1 5 1 67 Cal Programme \n", "1 209 2 4 1 67 Rai Programme \n", "2 210 3 6 1 67 Cal Programme \n", "0 211 1 3 1 68 Mod Proportionnel \n", "1 212 2 et 4 4 1 68 Rep Graphique \n", "2 213 3 4 1 68 Rep Graphique \n", "3 214 4 4 1 68 Com Graphique \n", "0 215 1 2 1 69 Cher Géométrie \n", "1 216 1 3 1 69 Mod Géométrie \n", "2 217 1 4 1 69 Cal Géométrie \n", "3 218 1 3 1 69 Com Géométrie \n", "4 219 2 3 1 69 Rai Géométrie \n", "0 220 3 1 70 Cher TC \n", "1 221 4 1 70 Cher TC \n", "2 222 4 1 70 Cal TC \n", "3 223 4 1 70 Com TC \n", "0 289 10 1 91 Com Présentation \n", "\n", " comment \n", "0 QCM \n", "1 QCM \n", "2 QCM \n", "3 QCM \n", "4 QCM \n", "0 Calcul proba \n", "1 Modification situation \n", "2 Nouvelle composition \n", "0 Que fait le programme \n", "1 Réponse à 13 \n", "2 Age pour conduire \n", "0 Application du calcul \n", "1 Renverser le calcul \n", "2 Appliquer à x et developper \n", "0 Proportionnalité \n", "1 Lecture graphique \n", "2 Écart de température \n", "3 Satisfaction \n", "0 Hypothèses \n", "1 Reconnaissance des théorèmes \n", "2 Calculs dans les théorèmes \n", "3 Réponse à la question \n", "4 Confiance au pilote \n", "0 Décomposition du problème \n", "1 Lecture des informations \n", "2 Calculs sensé \n", "3 Clarté des explications \n", "0 " ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "q_df" ] }, { "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
idnamescore_rateis_leveledexercise_idcompetencedomaincomment
020112164CalQCM
122422164CalQCM
222532164CalQCM
322642164RepQCM
422752164CalQCM
02021 à 34165RepProbaCalcul proba
120323165RaiProbaModification situation
220433165RaiProbaNouvelle composition
020513166ComScratchQue fait le programme
120624166RaiScratchRéponse à 13
220733166CherScratchAge pour conduire
020815167CalProgrammeApplication du calcul
120924167RaiProgrammeRenverser le calcul
221036167CalProgrammeAppliquer à x et developper
021113168ModProportionnelProportionnalité
12122 et 44168RepGraphiqueLecture graphique
221334168RepGraphiqueÉcart de température
321444168ComGraphiqueSatisfaction
021512169CherGéométrieHypothèses
121613169ModGéométrieReconnaissance des théorèmes
221714169CalGéométrieCalculs dans les théorèmes
321813169ComGéométrieRéponse à la question
421923169RaiGéométrieConfiance au pilote
02203170CherTCDécomposition du problème
12214170CherTCLecture des informations
22224170CalTCCalculs sensé
32234170ComTCClarté des explications
028910191ComPrésentation
\n", "
" ], "text/plain": [ " id name score_rate is_leveled exercise_id competence domain \\\n", "0 201 1 2 1 64 Cal \n", "1 224 2 2 1 64 Cal \n", "2 225 3 2 1 64 Cal \n", "3 226 4 2 1 64 Rep \n", "4 227 5 2 1 64 Cal \n", "0 202 1 à 3 4 1 65 Rep Proba \n", "1 203 2 3 1 65 Rai Proba \n", "2 204 3 3 1 65 Rai Proba \n", "0 205 1 3 1 66 Com Scratch \n", "1 206 2 4 1 66 Rai Scratch \n", "2 207 3 3 1 66 Cher Scratch \n", "0 208 1 5 1 67 Cal Programme \n", "1 209 2 4 1 67 Rai Programme \n", "2 210 3 6 1 67 Cal Programme \n", "0 211 1 3 1 68 Mod Proportionnel \n", "1 212 2 et 4 4 1 68 Rep Graphique \n", "2 213 3 4 1 68 Rep Graphique \n", "3 214 4 4 1 68 Com Graphique \n", "0 215 1 2 1 69 Cher Géométrie \n", "1 216 1 3 1 69 Mod Géométrie \n", "2 217 1 4 1 69 Cal Géométrie \n", "3 218 1 3 1 69 Com Géométrie \n", "4 219 2 3 1 69 Rai Géométrie \n", "0 220 3 1 70 Cher TC \n", "1 221 4 1 70 Cher TC \n", "2 222 4 1 70 Cal TC \n", "3 223 4 1 70 Com TC \n", "0 289 10 1 91 Com Présentation \n", "\n", " comment \n", "0 QCM \n", "1 QCM \n", "2 QCM \n", "3 QCM \n", "4 QCM \n", "0 Calcul proba \n", "1 Modification situation \n", "2 Nouvelle composition \n", "0 Que fait le programme \n", "1 Réponse à 13 \n", "2 Age pour conduire \n", "0 Application du calcul \n", "1 Renverser le calcul \n", "2 Appliquer à x et developper \n", "0 Proportionnalité \n", "1 Lecture graphique \n", "2 Écart de température \n", "3 Satisfaction \n", "0 Hypothèses \n", "1 Reconnaissance des théorèmes \n", "2 Calculs dans les théorèmes \n", "3 Réponse à la question \n", "4 Confiance au pilote \n", "0 Décomposition du problème \n", "1 Lecture des informations \n", "2 Calculs sensé \n", "3 Clarté des explications \n", "0 " ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "q_df" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'0 - Application du calcul': 208,\n", " '0 - Calcul proba': 202,\n", " '0 - Décomposition du problème': 220,\n", " '0 - Hypothèses': 215,\n", " '0 - Proportionnalité': 211,\n", " '0 - QCM': 201,\n", " '0 - Que fait le programme': 205,\n", " '1 - Lecture des informations': 221,\n", " '1 - Lecture graphique': 212,\n", " '1 - Modification situation': 203,\n", " '1 - QCM': 224,\n", " '1 - Reconnaissance des théorèmes': 216,\n", " '1 - Renverser le calcul': 209,\n", " '1 - Réponse à 13': 206,\n", " '2 - Age pour conduire': 207,\n", " '2 - Appliquer à x et developper': 210,\n", " '2 - Calculs dans les théorèmes': 217,\n", " '2 - Calculs sensé': 222,\n", " '2 - Nouvelle composition': 204,\n", " '2 - QCM': 225,\n", " '2 - Écart de température': 213,\n", " '3 - Clarté des explications': 223,\n", " '3 - QCM': 226,\n", " '3 - Réponse à la question': 218,\n", " '3 - Satisfaction': 214,\n", " '4 - Confiance au pilote': 219,\n", " '4 - QCM': 227,\n", " 'Présentation': 289}" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "cols = {}\n", "qcm = 0\n", "for c in xls_df.columns:\n", " a = q_df[q_df['comment']==c.split(' - ')[-1]]\n", " try:\n", " if \"QCM\" in c:\n", " cols[c] = a.id.values[qcm]\n", " qcm += 1\n", " else:\n", " cols[c] = a.id.values[0]\n", " except IndexError:\n", " # id de la question de présentation\n", " cols[c] = 289\n", "cols" ] }, { "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", "
289201224225226227202203204205...214215216217218219220221222223
ismou8200020002...4010001111
asbahati10202204333...4000033424
Hadaïta9022204303...4020133422
anissa8022224323...4000023444
raydel10002004303...4222033444
\n", "

5 rows × 28 columns

\n", "
" ], "text/plain": [ " 289 201 224 225 226 227 202 203 204 205 ... 214 215 216 217 218 219 \\\n", "ismou 8 2 0 0 0 2 0 0 0 2 ... 4 0 1 0 0 0 \n", "asbahati 10 2 0 2 2 0 4 3 3 3 ... 4 0 0 0 0 3 \n", "Hadaïta 9 0 2 2 2 0 4 3 0 3 ... 4 0 2 0 1 3 \n", "anissa 8 0 2 2 2 2 4 3 2 3 ... 4 0 0 0 0 2 \n", "raydel 10 0 0 2 0 0 4 3 0 3 ... 4 2 2 2 0 3 \n", "\n", " 220 221 222 223 \n", "ismou 1 1 1 1 \n", "asbahati 3 4 2 4 \n", "Hadaïta 3 4 2 2 \n", "anissa 3 4 4 4 \n", "raydel 3 4 4 4 \n", "\n", "[5 rows x 28 columns]" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "xls_df = xls_df.rename(columns=cols).drop([\"Competence\", 'Barème', \"anchoura\"])\n", "xls_df.head()" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "0 Taiassima\n", "1 Ismou\n", "2 Dhoulkamal\n", "3 Asbahati\n", "4 Ansufiddine\n", "5 Fayadhi\n", "6 Hadaïta\n", "7 Anissa\n", "8 Raydel\n", "9 Fatima\n", "10 Elzame\n", "11 Zalida\n", "12 Abdillah Mze Limassi\n", "13 Zaankidine\n", "14 Kayssoiria\n", "15 Asna\n", "16 Soibrata\n", "17 Doulkifly\n", "18 Nassur\n", "19 Anchoura\n", "20 Nadia\n", "21 Izak\n", "22 Bakari\n", "23 Fatoumia\n", "24 Claudiana\n", "25 Salahou\n", "26 Chaharzade\n", "Name: surname, dtype: object" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "s_df[\"surname\"]" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'Dhoulkamal': 3,\n", " 'Hadaïta': 7,\n", " 'abdillah mze': 13,\n", " 'anissa': 8,\n", " 'ansufiddine': 5,\n", " 'asbahati': 4,\n", " 'asna': 16,\n", " 'bakari': 23,\n", " 'chaharzade': 76,\n", " 'claudiana': 25,\n", " 'doulkifly': 18,\n", " 'elzame': 11,\n", " 'fatima': 10,\n", " 'fatoumia': 24,\n", " 'fayadhi': 6,\n", " 'ismou': 2,\n", " 'izak': 22,\n", " 'kayssoiria': 15,\n", " 'nadia': 21,\n", " 'nassur': 19,\n", " 'raydel': 9,\n", " 'salahou': 26,\n", " 'soibrata': 17,\n", " 'taiassima': 1,\n", " 'zaankidine': 14,\n", " 'zalida': 12}" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "studs = {}\n", "for s in xls_df.index:\n", " ss = s_df[s_df['surname'].str.contains(s, case=False)]\n", " ss = ss.id.values\n", " try:\n", " studs[s] = ss[0]\n", " except IndexError:\n", " print(f\"rien sur {s}\")\n", "studs" ] }, { "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
289201224225226227202203204205...214215216217218219220221222223
28200020002...4010001111
410202204333...4000033424
79022204303...4020133422
88022224323...4000023444
910002004303...4222033444
\n", "

5 rows × 28 columns

\n", "
" ], "text/plain": [ " 289 201 224 225 226 227 202 203 204 205 ... 214 215 216 217 218 219 220 221 \\\n", "2 8 2 0 0 0 2 0 0 0 2 ... 4 0 1 0 0 0 1 1 \n", "4 10 2 0 2 2 0 4 3 3 3 ... 4 0 0 0 0 3 3 4 \n", "7 9 0 2 2 2 0 4 3 0 3 ... 4 0 2 0 1 3 3 4 \n", "8 8 0 2 2 2 2 4 3 2 3 ... 4 0 0 0 0 2 3 4 \n", "9 10 0 0 2 0 0 4 3 0 3 ... 4 2 2 2 0 3 3 4 \n", "\n", " 222 223 \n", "2 1 1 \n", "4 2 4 \n", "7 2 2 \n", "8 4 4 \n", "9 4 4 \n", "\n", "[5 rows x 28 columns]" ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "xls_df = xls_df.rename(index=studs)\n", "xls_df.head()" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2 289 8\n", " 201 2\n", " 224 0\n", " 225 0\n", " 226 0\n", "dtype: object" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "xls_df = xls_df.stack()\n", "xls_df.head()" ] }, { "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", "
student_idquestion_idmark
022898
122012
222240
322250
422260
\n", "
" ], "text/plain": [ " student_id question_id mark\n", "0 2 289 8\n", "1 2 201 2\n", "2 2 224 0\n", "3 2 225 0\n", "4 2 226 0" ] }, "execution_count": 28, "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": 29, "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
022898
122012
222240
322250
422260
\n", "
" ], "text/plain": [ " student_id question_id mark\n", "0 2 289 8\n", "1 2 201 2\n", "2 2 224 0\n", "3 2 225 0\n", "4 2 226 0" ] }, "execution_count": 29, "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": 30, "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": 31, "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
02289828910191ComPrésentation
142891028910191ComPrésentation
27289928910191ComPrésentation
38289828910191ComPrésentation
492891028910191ComPrésentation
\n", "
" ], "text/plain": [ " student_id question_id mark id name score_rate is_leveled \\\n", "0 2 289 8 289 10 1 \n", "1 4 289 10 289 10 1 \n", "2 7 289 9 289 10 1 \n", "3 8 289 8 289 10 1 \n", "4 9 289 10 289 10 1 \n", "\n", " exercise_id competence domain comment \n", "0 91 Com Présentation \n", "1 91 Com Présentation \n", "2 91 Com Présentation \n", "3 91 Com Présentation \n", "4 91 Com Présentation " ] }, "execution_count": 31, "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": 32, "metadata": { "collapsed": true }, "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": 33, "metadata": { "collapsed": true }, "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": 34, "metadata": { "collapsed": true }, "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": 35, "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", "
student_idquestion_idmarkvalueid_xname_xsurnamemailcommmenttribe_id...is_leveledexercise_idcompetencedomaincomment_xidnameeval_iddatecomment_y
02289822ADANIIsmouNone1...191ComPrésentation91Présentation212018-02-18 00:00:00.000000
142891034AHAMADIAsbahatiNone1...191ComPrésentation91Présentation212018-02-18 00:00:00.000000
27289937AHMED SAIDHadaïtaNone1...191ComPrésentation91Présentation212018-02-18 00:00:00.000000
38289828ALI MADIAnissaNone1...191ComPrésentation91Présentation212018-02-18 00:00:00.000000
492891039ALIRaydelNone1...191ComPrésentation91Présentation212018-02-18 00:00:00.000000
\n", "

5 rows × 23 columns

\n", "
" ], "text/plain": [ " student_id question_id mark value id_x name_x surname mail \\\n", "0 2 289 8 2 2 ADANI Ismou \n", "1 4 289 10 3 4 AHAMADI Asbahati \n", "2 7 289 9 3 7 AHMED SAID Hadaïta \n", "3 8 289 8 2 8 ALI MADI Anissa \n", "4 9 289 10 3 9 ALI Raydel \n", "\n", " commment tribe_id ... is_leveled exercise_id competence \\\n", "0 None 1 ... 1 91 Com \n", "1 None 1 ... 1 91 Com \n", "2 None 1 ... 1 91 Com \n", "3 None 1 ... 1 91 Com \n", "4 None 1 ... 1 91 Com \n", "\n", " domain comment_x id name eval_id \\\n", "0 Présentation 91 Présentation 21 \n", "1 Présentation 91 Présentation 21 \n", "2 Présentation 91 Présentation 21 \n", "3 Présentation 91 Présentation 21 \n", "4 Présentation 91 Présentation 21 \n", "\n", " date comment_y \n", "0 2018-02-18 00:00:00.000000 \n", "1 2018-02-18 00:00:00.000000 \n", "2 2018-02-18 00:00:00.000000 \n", "3 2018-02-18 00:00:00.000000 \n", "4 2018-02-18 00:00:00.000000 \n", "\n", "[5 rows x 23 columns]" ] }, "execution_count": 35, "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 = pd.merge(sc_s_df, dnbBlanc.q_df, left_on='question_id', right_on='id')\n", "sc_s_df = pd.merge(sc_s_df, dnbBlanc.ex_df, left_on='exercise_id', right_on='id')\n", "sc_s_df.head()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Le compte y est! Ouf" ] }, { "cell_type": "code", "execution_count": 36, "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", "
markscore_rate
surnamename
Abdillah Mze Limassi1 - QCM810
2 - Boite de chocolat810
3 - Scratch1010
4 - Programme de calcul515
5 - Macaron815
\n", "
" ], "text/plain": [ " mark score_rate\n", "surname name \n", "Abdillah Mze Limassi 1 - QCM 8 10\n", " 2 - Boite de chocolat 8 10\n", " 3 - Scratch 10 10\n", " 4 - Programme de calcul 5 15\n", " 5 - Macaron 8 15" ] }, "execution_count": 36, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sc_s_df.groupby([\"surname\", \"name\"]).sum()[[\"mark\", 'score_rate']].head()" ] }, { "cell_type": "code", "execution_count": 37, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "surname\n", "Abdillah Mze Limassi 69\n", "Anissa 72\n", "Ansufiddine 26\n", "Asbahati 72\n", "Asna 60\n", "Name: mark, dtype: int64" ] }, "execution_count": 37, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sc_s_df.groupby([\"surname\"]).sum()[\"mark\"].head()" ] }, { "cell_type": "code", "execution_count": 38, "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
02289822ADANIIsmouNone128910191ComPrésentation
142891034AHAMADIAsbahatiNone128910191ComPrésentation
27289937AHMED SAIDHadaïtaNone128910191ComPrésentation
38289828ALI MADIAnissaNone128910191ComPrésentation
492891039ALIRaydelNone128910191ComPrésentation
\n", "
" ], "text/plain": [ " student_id question_id mark value id_x name_x surname mail \\\n", "0 2 289 8 2 2 ADANI Ismou \n", "1 4 289 10 3 4 AHAMADI Asbahati \n", "2 7 289 9 3 7 AHMED SAID Hadaïta \n", "3 8 289 8 2 8 ALI MADI Anissa \n", "4 9 289 10 3 9 ALI Raydel \n", "\n", " commment tribe_id id_y name_y score_rate is_leveled exercise_id \\\n", "0 None 1 289 10 1 91 \n", "1 None 1 289 10 1 91 \n", "2 None 1 289 10 1 91 \n", "3 None 1 289 10 1 91 \n", "4 None 1 289 10 1 91 \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": 38, "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": 39, "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": 40, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Path('.//302/report_DNB blanc 1.tex')" ] }, "execution_count": 40, "metadata": {}, "output_type": "execute_result" } ], "source": [ "datas = {\"evaluation\": dnbBlanc}\n", "target = build_target_name('302', 'DNB blanc 1')\n", "target" ] }, { "cell_type": "code", "execution_count": 41, "metadata": { "collapsed": true }, "outputs": [], "source": [ "template=\"tpl_reports_eval.tex\"" ] }, { "cell_type": "code", "execution_count": 42, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "b'! Package Rep Error: Undefinded type of answer: .\\n'\n", "b'! Package Rep Error: Undefinded type of answer: .\\n'\n", "b'! Package Rep Error: Undefinded type of answer: .\\n'\n", "b'! Package Rep Error: Undefinded type of answer: .\\n'\n", "b'! Package Rep Error: Undefinded type of answer: .\\n'\n" ] } ], "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 }