Skip to content

Commit

Permalink
*** empty log message ***
Browse files Browse the repository at this point in the history
  • Loading branch information
gustav_delius committed Feb 28, 2006
1 parent 4f48fb4 commit 062f112
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion question/export.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
}

if (! $category = get_record("quiz_categories", "id", $categoryid)) {
$category = quiz_get_default_category($courseid);
$category = get_default_question_category($courseid);
}

if (! $categorycourse = get_record("course", "id", $category->course)) {
Expand Down
2 changes: 1 addition & 1 deletion question/format.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function importprocess($filename) {
$question->stamp = make_unique_id_code(); // Set the unique code (not to be changed)
$question->version = 1; // Original version of this question

if (!$question->id = insert_record("quiz_questions", $question)) {
if (!$question->id = insert_record("question", $question)) {
error("Could not insert new question!");
}

Expand Down
10 changes: 5 additions & 5 deletions question/format/aon/format.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function importpostprocess() {

$questionids = implode(',', $this->questionids);

if (!$shortanswers = get_records_select("quiz_questions",
if (!$shortanswers = get_records_select("question",
"id IN ($questionids) AND qtype = ".SHORTANSWER,
"", "id,qtype")) {
return true;
Expand Down Expand Up @@ -155,7 +155,7 @@ function importpostprocess() {
$count = count($shortanswerids);

$extracts = get_records_sql("SELECT q.questiontext, a.answer
FROM {$CFG->prefix}quiz_questions q,
FROM {$CFG->prefix}question q,
{$CFG->prefix}quiz_shortanswer sa,
{$CFG->prefix}quiz_answers a
WHERE q.id in ($extractids)
Expand All @@ -172,7 +172,7 @@ function importpostprocess() {
$question->version = 1; // Original version of this question
$question->parent = 0;

if (!$question->id = insert_record("quiz_questions", $question)) {
if (!$question->id = insert_record("question", $question)) {
error("Could not insert new question!");
}

Expand All @@ -193,15 +193,15 @@ function importpostprocess() {

/// Delete the old short-answer questions

execute_sql("DELETE FROM {$CFG->prefix}quiz_questions WHERE id IN ($extractids)", false);
execute_sql("DELETE FROM {$CFG->prefix}question WHERE id IN ($extractids)", false);
execute_sql("DELETE FROM {$CFG->prefix}quiz_shortanswer WHERE question IN ($extractids)", false);
execute_sql("DELETE FROM {$CFG->prefix}quiz_answers WHERE question IN ($extractids)", false);

}

if ($count) { /// Delete the remaining ones
foreach ($shortanswerids as $shortanswerid) {
delete_records("quiz_questions", "id", $shortanswerid);
delete_records("question", "id", $shortanswerid);
delete_records("quiz_shortanswer", "question", $shortanswerid);
delete_records("quiz_answers", "question", $shortanswerid);
}
Expand Down
2 changes: 1 addition & 1 deletion question/format/coursetestmanager/format.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ function importprocess($filename) {
$question->category = $this->category->id;
$question->stamp = make_unique_id_code(); // Set the unique code (not to be changed)
$question->version = 1; // Original version of this question
if (!$question->id = insert_record("quiz_questions", $question)) {
if (!$question->id = insert_record("question", $question)) {
error("Could not insert new question!");
}
$this->questionids[] = $question->id;
Expand Down
2 changes: 1 addition & 1 deletion question/format/qti2/format.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ function exportprocess($filename) {
}

// get the questions (from database) in this category
// $questions = get_records("quiz_questions","category",$this->category->id);
// $questions = get_records("question","category",$this->category->id);
$questions = get_questions_category( $this->category );

notify("Exporting ".count($questions)." questions.");
Expand Down
2 changes: 1 addition & 1 deletion question/import.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
if (! $category = get_record("quiz_categories", "id", $categoryid)) {
// if no valid category was given, use the default category
if ($courseid) {
$category = quiz_get_default_category($courseid);
$category = get_default_question_category($courseid);
} else {
error("No category specified");
}
Expand Down

0 comments on commit 062f112

Please sign in to comment.