/lenasys/0.1

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/lenasys/0.1

« back to all changes in this revision

Viewing changes to trunk/DuggaSys/quizAjax/answerQuiz.php

  • Committer: gustav.hartvigsson at gmail
  • Date: 2013-04-02 13:00:31 UTC
  • mfrom: (4.7.8 GammaBear)
  • Revision ID: gustav.hartvigsson@gmail.com-20130402130031-442y89s0cfzmw3r2
Merged stuff.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 
9
9
session_start();
10
10
//Check if the sent login name is the same as the one stored in the session
11
 
if($_POST['loginName']==$_SESSION['loginName'] && $_POST['courseName']==$_SESSION['courseName'] && $_POST['quizNr']==$_SESSION['quizNr']){ 
 
11
if($_POST['loginName']==$_SESSION['loginName'] && $_POST['courseName']==$_SESSION['courseName'] && $_POST['quizNr']==$_SESSION['quizNr']) { 
12
12
 
13
13
        //Store answer and loginName+answer hash
14
 
        function storeAnswer($loginName,$courseName,$courseOccasion,$quizNr,$qVarRr,$quizAnswer,$grade,$gradeComment,$ip,$userAgent,$pdo){
 
14
        function storeAnswer($loginName,$courseName,$courseOccasion,$quizNr,$qVarRr,$quizAnswer,$grade,$gradeComment,$ip,$userAgent,$pdo) {
15
15
                $updateQuery="UPDATE AssignedQuizzes 
16
16
                                          SET AssignedQuizzes.answer=:ANSWER, 
17
17
                                                  AssignedQuizzes.answerHash=:ANSWERHASH, 
131
131
        $stmt->bindParam(':COCCASION', $_SESSION['courseOccasion']);
132
132
        $stmt->execute();
133
133
 
134
 
        if($stmt->fetchColumn()==1){ //Student is registered for the course - COUNT result read from the first column of the next unread row (i.e. the first row) 
 
134
        if($stmt->fetchColumn()==1) { //Student is registered for the course - COUNT result read from the first column of the next unread row (i.e. the first row) 
135
135
                //Check if quiz is open (and fetch auto correction setting)
136
136
                $queryString="SELECT Quiz.opening, Quiz.closing, Quiz.autoCorrected, Quiz.allowMultipleReplies
137
137
                                           FROM Quiz