Update of /cvsroot/stack/stack-1-0
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15865
Modified Files:
editquiz.php import.php
Log Message:
Instancing of new quiz moved to stackQuiz
Order fields added to quiz_question db table
Index: import.php
===================================================================
RCS file: /cvsroot/stack/stack-1-0/import.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** import.php 30 Aug 2005 12:20:29 -0000 1.7
--- import.php 30 Aug 2005 13:51:54 -0000 1.8
***************
*** 258,261 ****
--- 258,262 ----
stack_question_validate($quizQuestions[$key],$errs[$key]);
stack_xml_reinstate_question_meta_defaults($qu); //Reinstate any missing question metadata
+
$qu['questionID'] = stack_db_question_add($qu); //Add question to db, and retrieve its new ID
echo "<tr>\n <td>".sf($qu,'questionID')."</td> <td>".sf($qu,'questionName')." </td> <td>".sf($qu,'questionDescription')." </td> <td>".sf($qu,'questionKeywords')." </td>";
***************
*** 278,283 ****
echo "<td><font color=\"greed\">Valid question</font></td>";
//For each valid question we must also add the question to the database
! stack_db_quiz_add_question($quiz['quizid'],$qu['questionID']); //For each question, add link from quiz to question
}
echo "</tr>\n";
--- 279,286 ----
echo "<td><font color=\"greed\">Valid question</font></td>";
+ show_array($key);
//For each valid question we must also add the question to the database
! stack_db_quiz_add_question($quiz['quizid'],$qu['questionID'],$key); //For each question, add link from quiz to question
! //explicitly state question order
}
echo "</tr>\n";
Index: editquiz.php
===================================================================
RCS file: /cvsroot/stack/stack-1-0/editquiz.php,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** editquiz.php 30 Aug 2005 12:20:28 -0000 1.19
--- editquiz.php 30 Aug 2005 13:51:54 -0000 1.20
***************
*** 152,168 ****
if ('quiz_new' == $action) {
! $quiz['quizid'] = $quizid;
!
! //Automatically generated quiz metadata added
! $quiz['quizGUID'] = stack_generate_guid($stack_web_url);
! $quiz['quizFormat'] = 'text/xml; charset="utf-8"';
! $quiz['quizPublisher'] = $stack_web_url;
! $quiz['type'] = 'quiz';
! $quiz['quizUserLastEdited'] = $user['firstname']." ".$user['lastname'];
!
! if ($user['email']!='')
! {
! $question['questionUserLastEdited'].=' <'.$user['email'].'>';
! }
$action = 'quiz_edit';
--- 152,156 ----
if ('quiz_new' == $action) {
! $quiz = stack_quiz_new($quizid);
$action = 'quiz_edit';
|