Commits

Rémy HUBSCHER committed ec4393e

Corrections nombre de questions + os.remove + taille player

Comments (0)

Files changed (3)

editor/views/QtGui.py

         if sound_filename:
             self.current_path = os.path.basename(sound_filename)
             if fileName.text() != '':
-                os.path.remove('quiz/sounds/%s' % fileName.text())
+                os.remove('quiz/sounds/%s' % fileName.text())
                 
             i = 0
             partial_filename = os.path.basename(sound_filename).replace('.mp3', '')
             fileName.setText(test_filename+'.mp3')
         else:
             if fileName.text() != '':
-                ok = QtGui.QMessageBox.question(self, u'Supprimer le sound ?', u"Un son existe déjà pour cette réponse, souhaitez-vous le supprimer ?")
+                ok = QtGui.QMessageBox.question(self, u'Supprimer le sound ?', u"Un son existe déjà pour cette réponse, souhaitez-vous le supprimer ?", QtGui.QMessageBox.Yes, QtGui.QMessageBox.No)
 
-                if ok == QMessageBox.Ok:
-                    os.path.remove('quiz/sounds/%s' % fileName.text())
+                if ok == QtGui.QMessageBox.Yes:
+                    os.remove('quiz/sounds/%s' % fileName.text())
                     fileName.setText('')
 
     def browseSoundQuestion(self):

packs/quiz/css/styles.css

     position: relative;
     display: block;
     margin-top: -12px;
-    margin-left: 65px;
+    margin-left: 85px;
 }
 
 input[type=radio] {

packs/quiz/js/start-quiz.js

 function startGame(questions) {
     current_question = 0;
     questions = $.shuffle(questions);
+    $("#totalQuestions").html(questions.length);
     loadQuestion(current_question);
 }
 
 	$("#numQuestion").html(current_question+1);
 	$('#question').html(q.texte);
 	if(q.sound) {
-	    swfobject.embedSWF("js/dewplayer/dewplayer.swf", "qsound", "60", "20", "9.0.0", false, {'mp3': 'sounds/'+q.sound}, {'wmode': 'transparent'});
+	    swfobject.embedSWF("js/dewplayer/dewplayer.swf", "qsound", "80", "20", "9.0.0", false, {'mp3': 'sounds/'+q.sound}, {'wmode': 'transparent'});
 	    $('#qsound').show();
 	} else {
 	    $('#qsound').hide();
 	    r = reponses[i];
 	    id = 'r'+(i+1)+'sound';
 	    if(r.sound) {
-		swfobject.embedSWF("js/dewplayer/dewplayer.swf", id, "60", "20", "9.0.0", false, {'mp3': 'sounds/'+r.sound}, {'wmode': 'transparent'});
+		swfobject.embedSWF("js/dewplayer/dewplayer.swf", id, "80", "20", "9.0.0", false, {'mp3': 'sounds/'+r.sound}, {'wmode': 'transparent'});
 		$('#'+id).show();
 	    } else {
 		$('#'+id).hide();
     } else {
 	$('#questions').hide();
 	$('#fin').show();
-	$('#results').html($('#score').html()+'/10');
+	$('#results').html($('#score').html()+'/'+$("#totalQuestions").html());
     }
 }