TEST - Tipo UF

Segnalate qui eventuali problemi riscontrati durante il normale utilizzo
Post Reply
User avatar
tonymask
Newbie
Posts: 13
Joined: Thu Nov 03, 2016 11:40 am
Version: forma.lms 1.4.1
Contact:

TEST - Tipo UF

Post by tonymask » Thu Mar 09, 2017 9:39 am

Salve,
ho provato a inserire in un TEST una domanda di Tipo UF (caricamento file) ma al momento di fare il test viene fuori l'errore:

Error on move_uploaded_file from: /tmp/php6A6oSQ to /appLms/field/NOMEDELMIOFILE

cosa può essere ? :?:

jasmines
FormaLms Master
Posts: 277
Joined: Fri May 03, 2013 12:29 pm

Re: TEST - Tipo UF

Post by jasmines » Thu Mar 09, 2017 9:58 am

Mi incolli l'intera function storeAnswer che si trova in /appLms/modules/question/class.upload.php?
E dammi anche il risultato di questa query sul db: SELECT * FROM vittoria_edotta_db.core_setting where param_name like "path%"

User avatar
tonymask
Newbie
Posts: 13
Joined: Thu Nov 03, 2016 11:40 am
Version: forma.lms 1.4.1
Contact:

Re: TEST - Tipo UF

Post by tonymask » Thu Mar 09, 2017 10:11 am

Ecco la query
You do not have the required permissions to view the files attached to this post.

User avatar
tonymask
Newbie
Posts: 13
Joined: Thu Nov 03, 2016 11:40 am
Version: forma.lms 1.4.1
Contact:

FUNZIONE

Post by tonymask » Thu Mar 09, 2017 10:15 am

function storeAnswer( $id_track, &$source, $can_overwrite = false ) {


require_once(_base_.'/lib/lib.upload.php');

if($this->userDoAnswer($id_track)) {
if($can_overwrite) {

return $this->updateAnswer($id_track, $source);
}
else return false;
}

$savefile = '';
//save file--------------------------------------------------------
if(isset($_FILES['quest']['name'][$this->id]) && ($_FILES['quest']['name'][$this->id] != '')) {

$path = '/appLms/'.Get::sett('pathtest');

$savefile = $_SESSION['idCourse'].'_'.$this->id.'_'.mt_rand(0, 100).time().'_'.$_FILES['quest']['name'][$this->id];
if(!file_exists($GLOBALS['where_files_relative'].$path.$savefile )) {

sl_open_fileoperations();
if(!sl_upload($_FILES['quest']['tmp_name'][$this->id], $path.$savefile)) {

$savefile = Lang::t('_QUEST_ERR_IN_UPLOAD');
}
sl_close_fileoperations();
} else {
$savefile = Lang::t('_QUEST_ERR_IN_UPLOAD');
}
}
//answer checked by the user
$track_query = "
INSERT INTO ".$GLOBALS['prefix_lms']."_testtrack_answer ( idTrack, idQuest, idAnswer, score_assigned, more_info, user_answer )
VALUES (
'".(int)$id_track."',
'".(int)$this->id."',
'0',
'0',
'".addslashes($savefile)."',
1 )";
return sql_query($track_query);

}

jasmines
FormaLms Master
Posts: 277
Joined: Fri May 03, 2013 12:29 pm

Re: TEST - Tipo UF

Post by jasmines » Thu Mar 09, 2017 11:59 am

esegui questa query:
update core_setting set param_value = "test/" where param_name = "pathtest";
e dimmi se funziona
Controlla che la cartella /files/ (e sottocartelle) sia scrivibile

User avatar
tonymask
Newbie
Posts: 13
Joined: Thu Nov 03, 2016 11:40 am
Version: forma.lms 1.4.1
Contact:

Re: TEST - Tipo UF

Post by tonymask » Thu Mar 09, 2017 12:36 pm

GRAZIE, SEI UN GRANDE !

Post Reply