2

I would like my kid to complete an online lesson from this website: http://www.typingweb.com/ before allowing him to use the computer (specifically: playing Minecraft!).

Is there any way to do this?

I run Windows 7 Ultimate. Special browser versions, user accounts, etc. may be installed (or created) if needed.

2
  • 2
    is there any way to tell if he finished the lesson automatically, i.e. a completion certificate that he prints out or saves, or an email from the site that says he finished. If not, then the easiest way is going to be creating a separate account and password protecting his normal one so he cannot log in and play minecraft without your permission, thus allowing you to check his completion.
    – sww1235
    Commented Sep 28, 2014 at 9:06
  • so, is there a daily lesson or something? that, in the end, redirects you to a 'well done' page, or similar...? Commented Sep 28, 2014 at 14:36

1 Answer 1

0

I ended up writing the following code which logs in as teacher and pulls a report which shows how many second your student has spent today. In my case I just created my account as teacher and son as student and I just check that he's spent 5 minutes or more. The Groovy script below gets executed (using a .BAT wrapper) upon my son's account, and logs off if he's not done the required 5 mins.

@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.5.2')
import groovyx.net.http.*
import static groovyx.net.http.ContentType.URLENC

import javax.xml.ws.handler.Handler
import javax.xml.ws.http.HTTPBinding

def http = new HTTPBuilder("https://www.typingweb.com")

http.post( path: '/portal/index/login', body: [email: '[email protected]', password: 'yourpasswordhere'],
        requestContentType: URLENC ) { resp, reader ->

    println "response status: ${resp.statusLine}"
    println 'Headers: -----------'
    resp.headers.each { h ->
        println " ${h.name} : ${h.value}"
    }
    println 'Response data: -----'
    System.out << reader
    println '\n--------------------'
}

def today = new Date().format( 'yyyy-MM-dd' )

println today


http.post( path: "/portal/reports/run/export/1/date/${today}/dateRange/today/endDate//startDate//gaGroupID/all/report/exercises/format/csv"
        ) { resp, reader ->

    println "response status: ${resp.statusLine}"
    println 'Headers: -----------'
    resp.headers.each { h ->
        println " ${h.name} : ${h.value}"
    }
    println 'Response data: -----'
    def lastLine
    reader.eachLine{ line ->
        lastLine = line
    }

    println lastLine

    def seconds = lastLine.split(',')[4].replaceAll('"', '')
    println seconds

    if ( seconds.isNumber() && (seconds.toInteger() >= 300) ) {
        println "Quitting WITHOUT logging off"
        System.exit(0);
    }

    def proc = """msg * "Tienes que hacer 5 minutos de escribir a maquina" """.execute()
    proc.waitFor()
    println "Logging off..."
    """logoff""".execute()
}
2
  • 0_0. Might help to say what language. Java?
    – Journeyman Geek
    Commented Sep 30, 2014 at 14:16
  • It's Groovy (it's mentioned in the response)
    – antorsae
    Commented Sep 30, 2014 at 14:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .