Date Tags teaching

During my lessons or labworks, I try to promote interactions between me and the students. But some reasons, it is not so easy to interact with them. They usually wait for answers, and/or are afraid to be wrong. So, I am waiting and they are waiting … very exiting :(

So, I need to trick/help them. First, I must prepare something which ensure anonymity. Second, it should work even if all the students did not play the game.

One possibility I have experimented is to use online collaborative spreadsheet, as EtherCalc or Framacalc. During labworks I ask them to fill the spreadsheet with the output of their processing. Hence, it is possible to start the discussion with their results, for instance by asking two groups to understand why their results are so different. It works fine. But I need to be on my computer to update results, or to check for some ***g jokes.

Now, thanks to a colleague of mine, I have write a short Python script that reads the data online, remove “outliers”, and plot the results. By doing, this I am able to display the results in a more intuitive way than table, and I can discuss with each group. Furthermore, since the display is updated every time a group of student send their results, they are more motivated.

Below I provide some piece of codes I use to illustrate the within and between variance of pixel graylevel distribution: each group should pick up some pixels for different class (forest, water, bare soil and grassland) and fill the online spreadsheet with the obtained values. Then, mean value and standard deviation is computed and displayed. Since I have on average 15 groups, I am pretty sure to get it.

import scipy as sp
import urllib2
import time
import os
import matplotlib.pyplot as plt

URL = ['https://framacalc.org/fauvel_rs_water','https://framacalc.org/fauvel_rs_grassland','https://framacalc.org/fauvel_rs_forest','https://framacalc.org/fauvel_rs_baresoil']
LABEL = ['Water','Grassland','Forest','Bare soil']
COLOR = ['b','g','r','m']
fig=plt.figure()
plt.ion()
plt.show()

while True:
    for i,url in enumerate(URL):
        try:
            with open('temp.csv','wb') as file:
                file.write(urllib2.urlopen(url+'.csv').read())
            data = sp.loadtxt('temp.csv',delimiter=',',skiprows=1)
            os.remove("temp.csv")

            m,s=data.mean(axis=0),data.std(axis=0)

            ax = fig.add_subplot(4,1,i+1)
            ax.clear()
            ax.plot(range(1,5),m,'k',lw=2)
            ax.fill_between(range(1,5),m-s,m+s,alpha=0.5,facecolor=COLOR[i])
            ax.set_title(LABEL[i])
            plt.draw()
            time.sleep(2)
        except KeyboardInterrupt:
            exit()
        except:
            print("Error in reading class {0}".format(LABEL[i]))

Comments

comments powered by Disqus