- ...
This commit is contained in:
		
							parent
							
								
									4814c357eb
								
							
						
					
					
						commit
						aeee5b5275
					
				@ -48,6 +48,9 @@ class LogicUtils
 | 
			
		||||
            }
 | 
			
		||||
        } else {
 | 
			
		||||
            $numa_str = self::extend($numa_str, $base, $digits, false);
 | 
			
		||||
            if (($rep === "c") && ($numa_str[0] >= ($base / 2))) {
 | 
			
		||||
                $numa_str = str_pad($numa_str, 1, "0", STR_PAD_LEFT);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return $numa_str;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -14,7 +14,11 @@ class LogicFunctionTask extends LogicTaskBase
 | 
			
		||||
        if (!$this->hasFlag("dnf")) {
 | 
			
		||||
            $this->setCorrectAnswer($this->getLogicFunction()->getExpression());
 | 
			
		||||
        } else {
 | 
			
		||||
            $this->setCorrectAnswer($this->getLogicFunction()->toDNF());
 | 
			
		||||
            $dnf = $this->getLogicFunction()->toDNF();
 | 
			
		||||
            if ($dnf === "") {
 | 
			
		||||
                $dnf = "0";
 | 
			
		||||
            }
 | 
			
		||||
            $this->setCorrectAnswer($dnf);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -89,10 +89,6 @@ class LogicTaskBase extends PicturedTask
 | 
			
		||||
        $this->lf = LogicFunction::genRandomDNF(LuaUtils::l2pA($input_vars));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function getFunctionAsDNF(): string {
 | 
			
		||||
        return $this->lf->toDNF();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public function setLogicFunctionExpr(string $expr, array $input_vars = []): void {
 | 
			
		||||
        $this->lf = new LogicFunction($expr, LuaUtils::l2pA($input_vars));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user