Commit 556bdc2f authored by Florent Chehab's avatar Florent Chehab
Browse files

clean

parent 8f2646fe
......@@ -131,7 +131,7 @@
" taux_eval = d['nb_evals']/(d['nb_etu_registered']-d['nb_etu_abs'])\n",
" taux_eval[taux_eval>1]=1\n",
" taux_eval = taux_eval.fillna(1) # Sometimes there 0 students in a course but there are evaluations\n",
" self.taux_eval_arr = 100 * taux_eval\n",
" self.taux_eval_arr = 100 * taux_eval.round(4)\n",
" self.taux_eval = sum(self.taux_eval_arr) / self.nb_uvs\n",
" self.uvs_with_evals = d.loc[pd.notna(d['date_review_teacher'])]\n",
" self.nb_uvs_with_evals = len(self.uvs_with_evals.index)\n",
......@@ -272,11 +272,12 @@
" if type(q) is int:\n",
" q = str(q)\n",
" \n",
" return sum([stat[q][POSSIBLE_ANSWERS[i]] * \\\n",
" val = sum([stat[q][POSSIBLE_ANSWERS[i]] * \\\n",
" POSSIBLE_ANSWERS_COEFFS[i] \\\n",
" for i in range(len(POSSIBLE_ANSWERS_COEFFS))])\\\n",
" / get_nb_evals(stat)\n",
"\n",
" return round(val,2)\n",
" \n",
"POSSIBLE_ANSWERS_COL = [\n",
" 'rgb(255,48,48)',\n",
" 'rgb(255,165,0)', \n",
......@@ -409,7 +410,7 @@
"graph_data = [\n",
" go.Scatter(\n",
" x=uvs_with_evals['date_review_teacher'].sort_values(),\n",
" y=[100*float(i+1)/EVALS_MAIN_SEM.nb_uvs for i,e in enumerate(uvs_with_evals.index)],\n",
" y=[round(100*float(i+1)/EVALS_MAIN_SEM.nb_uvs,2) for i,e in enumerate(uvs_with_evals.index)],\n",
" text=uvs_with_evals.sort_values(by=['date_review_teacher']).index,\n",
" marker=dict(color=ORANGE)\n",
" )\n",
......@@ -463,7 +464,7 @@
" traces.append(\n",
" go.Scatter(\n",
" x=d.uvs_with_evals['date_review_teacher'].sort_values().apply(datetime.toordinal)-sem_end_date ,\n",
" y=[100*float(i+1)/d.nb_uvs for i,e in enumerate(d.uvs_with_evals.index)],\n",
" y=[round(100*float(i+1)/d.nb_uvs,2) for i,e in enumerate(d.uvs_with_evals.index)],\n",
" text=d.uvs_with_evals.sort_values(by=['date_review_teacher']).index,\n",
" name=sem\n",
" ) \n",
......
......@@ -108,7 +108,7 @@
<select id='UV-select' onchange="update_display(this.value);">
</select>
<input id="UV-input-text" type="text">
<input type="button" value="Visualiser" onclick="update_select($('#UV-input-text').val())">
<input id="UV-input-btn" type="button" disabled value="Visualiser" onclick="update_select($('#UV-input-text').val())">
</form>
</div>
......@@ -313,13 +313,7 @@
// js for handling input uv name
var update_select = function (uv){
for (ind in all_uvs) {
if (all_uvs[ind] == uv) {
$("#UV-select").val(uv).change();
return true;
}
}
return false;
$("#UV-select").val(uv).change();
}
$('#UV-input-text').keyup(function (event) {
......@@ -342,6 +336,13 @@
while(!check_input(val)) {
val = val.substring(0, val.length - 1);
}
var state = true;
for (ind in all_uvs){
if (all_uvs[ind] == val){
state = false;
}
}
$('#UV-input-btn').prop('disabled', state);
}
$('#UV-input-text').val(val);
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment