You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
// Kontrola, že org neposílá nějakou blbost v detail.html
function zkontroluj_hodnoceni ( ) {
const pocet = $ ( '.hodnoceni' ) . length ;
if ( pocet === 1 ) { // vidím pouze plusko
const vysledek = confirm ( "Odstranil jsi všechny problémy tohoto řešení. Nepůjde tedy dohledat přes problémy, co řeší, tj. například v došlých řešeních. Přesto odeslat?" ) ;
if ( ! vysledek ) {
event . preventDefault ( ) ;
return false ;
}
}
function problem_is_empty ( elem , index , array ) { return elem . firstElementChild . children . length !== 1 && elem . firstElementChild . children [ 1 ] . textContent === "" ; }
if ( $ ( '.hodnoceni' ) . toArray ( ) . some ( problem_is_empty ) ) {
alert ( "Neuloženo! Nezadal jsi problém, ke kterému posíláš hodnocení. Pokud je toto hodnocení navíc, smaž ho prosím křížkem a znovu odešli." )
event . preventDefault ( )
return false ;
}
return true ;
}