function get_grades($singledata, $reference)
{
    $aux = new stdClass();
    //print_object($singledata);
    if (($labeli = find_label($singledata, $reference)) !== 0) {
        //print_object($labeli);
        $label = $labeli->label;
    }
    $aux->label = $label;
    $text = $label . '=';
    //print $aux->label;
    if (($valuei = find_element($singledata, $text)) !== 0) {
        if ($label !== 'USERID' and $label !== 'TEMPLATEFIELD' and $label !== 'Align' and $label !== 'Filename') {
            if ($valuei == 'true' or $valuei == 'marked' or $valuei == 1) {
                $valuei = 1;
            } else {
                if ($valuei == '?') {
                    $valuei = '?';
                } else {
                    $valuei = 0;
                }
            }
        }
        if ($valuei == null) {
            $valuei = 0;
        }
        $aux->value = $valuei;
    }
    return $aux;
}
Exemple #2
0
 public function uploadFile($sel, $filepath)
 {
     find_element($sel)->value(realpath($filepath));
 }