From cd63d77e0800b68a216247a032f414fe603631d7 Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 22 Oct 2002 10:38:00 +0000 Subject: [PATCH] Added help pages to quiz module. A few little cleanups, such as trim() on shortanswers --- lang/en/help/quiz/attempts.html | 6 +++++ lang/en/help/quiz/categories.html | 17 ++++++++++++ lang/en/help/quiz/correctanswers.html | 6 +++++ lang/en/help/quiz/feedback.html | 5 ++++ lang/en/help/quiz/grademethod.html | 25 ++++++++++++++++++ lang/en/help/quiz/maxgrade.html | 11 ++++++++ lang/en/help/quiz/multichoice.html | 19 ++++++++++++++ lang/en/help/quiz/questiontypes.html | 37 +++++++++++++++++++++++++++ lang/en/help/quiz/random.html | 3 +++ lang/en/help/quiz/shortanswer.html | 10 ++++++++ lang/en/help/quiz/timeopen.html | 5 ++++ lang/en/help/quiz/truefalse.html | 11 ++++++++ mod/quiz/attempt.php | 2 +- mod/quiz/category.php | 5 +++- mod/quiz/lib.php | 3 ++- mod/quiz/mod.html | 7 +++++ mod/quiz/question.php | 15 ++++++----- mod/quiz/report.php | 3 +++ 18 files changed, 180 insertions(+), 10 deletions(-) create mode 100644 lang/en/help/quiz/attempts.html create mode 100644 lang/en/help/quiz/categories.html create mode 100644 lang/en/help/quiz/correctanswers.html create mode 100644 lang/en/help/quiz/feedback.html create mode 100644 lang/en/help/quiz/grademethod.html create mode 100644 lang/en/help/quiz/maxgrade.html create mode 100644 lang/en/help/quiz/multichoice.html create mode 100644 lang/en/help/quiz/questiontypes.html create mode 100644 lang/en/help/quiz/random.html create mode 100644 lang/en/help/quiz/shortanswer.html create mode 100644 lang/en/help/quiz/timeopen.html create mode 100644 lang/en/help/quiz/truefalse.html diff --git a/lang/en/help/quiz/attempts.html b/lang/en/help/quiz/attempts.html new file mode 100644 index 00000000000..a912d92b526 --- /dev/null +++ b/lang/en/help/quiz/attempts.html @@ -0,0 +1,6 @@ +

Quiz attempts

+ +

Students may be allowed to have multiple attempts at a quiz. + +

This can help make the process of taking the quiz more of + an educational activity rather than simply an assessment. diff --git a/lang/en/help/quiz/categories.html b/lang/en/help/quiz/categories.html new file mode 100644 index 00000000000..f0a21f987f4 --- /dev/null +++ b/lang/en/help/quiz/categories.html @@ -0,0 +1,17 @@ +

Question categories

+ +

Rather than keeping all your questions in one big list, + you can create categories to keep them in. + +

Each category consists of a name and a short description. + +

Each category can also be "published", which means + that the category (and all questions in it) will be + available to all courses on this server, so that + other courses can use your questions in their quizzes. + +

Categories can also be created or deleted at will. + However, if you try to delete a category containing + questions, then you will be asked to specify another + category to move them to. + diff --git a/lang/en/help/quiz/correctanswers.html b/lang/en/help/quiz/correctanswers.html new file mode 100644 index 00000000000..3a42e9efa41 --- /dev/null +++ b/lang/en/help/quiz/correctanswers.html @@ -0,0 +1,6 @@ +

Show correct answers

+ +

If you enable correct answers, then the +feedback will show also show the correct answer +for each question (highlighted in a bright colour). +

diff --git a/lang/en/help/quiz/feedback.html b/lang/en/help/quiz/feedback.html new file mode 100644 index 00000000000..8d16da6f654 --- /dev/null +++ b/lang/en/help/quiz/feedback.html @@ -0,0 +1,5 @@ +

Feedback

+ +

If you enable quiz feedback, then students will receive + question feedback on every answer (right or wrong).

+ diff --git a/lang/en/help/quiz/grademethod.html b/lang/en/help/quiz/grademethod.html new file mode 100644 index 00000000000..fe5289c8574 --- /dev/null +++ b/lang/en/help/quiz/grademethod.html @@ -0,0 +1,25 @@ +

Grading method

+ +

When multiple attempts are allowed, there are different ways + you can use the grades to calculate the student's final + grade for the quiz. + +

Highest grade

+

+ +

Average grade

+

+ +

First grade

+

+ +

Last grade

+

diff --git a/lang/en/help/quiz/maxgrade.html b/lang/en/help/quiz/maxgrade.html new file mode 100644 index 00000000000..d3841862d4a --- /dev/null +++ b/lang/en/help/quiz/maxgrade.html @@ -0,0 +1,11 @@ +

Maximum grade

+ +

The maximum grade you set for a quiz is what all grades + are scaled to. + +

For example, you might set the max grade to 20, because the + quiz is worth 20% of the whole course. + +

Even though you might have 10 questions in your quiz + worth a total of 50 marks, all grades out of 50 will be + "scaled down" to the quiz max grade of 20. diff --git a/lang/en/help/quiz/multichoice.html b/lang/en/help/quiz/multichoice.html new file mode 100644 index 00000000000..52682ffa7c9 --- /dev/null +++ b/lang/en/help/quiz/multichoice.html @@ -0,0 +1,19 @@ +

Multiple Choice questions

+ +

In response to a question (that may include a image) the respondent + chooses from multiple answers. There are two types of multiple choice + questions - single answer and multiple answer. + +

Single-answer questions allow one and only one answer to be chosen. + Generally all the grades for such a question should be positive. + +

Multiple-answer questions allow one or more answers to be chosen - each answer + may carry a positive or negative grade, so that choosing ALL the options + will not necessarily result in good grade. If the total grade is negative + then the total grade for this question will be zero. Careful, it is + possible to create questions that have scores greater than 100%. + +

Finally, each answer (right or wrong) should include feedback - this feedback + will be shown to the respondent next to each of their answers (if the quiz + itself is configured to show feedback). +

diff --git a/lang/en/help/quiz/questiontypes.html b/lang/en/help/quiz/questiontypes.html new file mode 100644 index 00000000000..f3fc1301604 --- /dev/null +++ b/lang/en/help/quiz/questiontypes.html @@ -0,0 +1,37 @@ +

Creating a new question

+ +

You can add a variety of different types of questions to a category:

+ +

Multiple Choice

+ + +

Short Answer

+ + +

True/False

+ + +

Random

+ + diff --git a/lang/en/help/quiz/random.html b/lang/en/help/quiz/random.html new file mode 100644 index 00000000000..6aaf9c38ca8 --- /dev/null +++ b/lang/en/help/quiz/random.html @@ -0,0 +1,3 @@ +

Random question

+ + diff --git a/lang/en/help/quiz/shortanswer.html b/lang/en/help/quiz/shortanswer.html new file mode 100644 index 00000000000..39f343310b5 --- /dev/null +++ b/lang/en/help/quiz/shortanswer.html @@ -0,0 +1,10 @@ +

Short Answer questions

+ +

In response to a question (that may include a image) the respondent + types a word or short phrase. + +

There may be several possible correct answers, each with a different + grade. If the "Case sensitive" option is selected, then you can + have different scores for "Word" or "word". + +

Answers are compared exactly, so be careful with your spelling! diff --git a/lang/en/help/quiz/timeopen.html b/lang/en/help/quiz/timeopen.html new file mode 100644 index 00000000000..5bda122a35f --- /dev/null +++ b/lang/en/help/quiz/timeopen.html @@ -0,0 +1,5 @@ +

Opening and closing the quiz

+ +

You can specify times when the quiz is accessible for people to make attempts. + +

Before the opening time, and after the closing time, the quiz will be unavailable. diff --git a/lang/en/help/quiz/truefalse.html b/lang/en/help/quiz/truefalse.html new file mode 100644 index 00000000000..7323375a249 --- /dev/null +++ b/lang/en/help/quiz/truefalse.html @@ -0,0 +1,11 @@ +

True/False questions

+ + +

In response to a question (that may include a image) the respondent + chooses from True or False. + +

If feedback is enabled, then the appropriate feedback message is + shown to the respondent after answering the quiz. For example, + if the correct answer is "False", but they answer "True" (getting + it wrong) then the "True" feedback is shown. +

diff --git a/mod/quiz/attempt.php b/mod/quiz/attempt.php index 5b1f6eefd8a..3e92c67d10a 100644 --- a/mod/quiz/attempt.php +++ b/mod/quiz/attempt.php @@ -106,7 +106,7 @@ error("Answer received for non-existent question ($key)!"); } } - $questions[$key]->answer[] = $value; // Store answers in array + $questions[$key]->answer[] = trim($value); // Store answers in array (whitespace trimmed) } } diff --git a/mod/quiz/category.php b/mod/quiz/category.php index 4de75c88b10..53675dfbca1 100644 --- a/mod/quiz/category.php +++ b/mod/quiz/category.php @@ -81,7 +81,10 @@ /// Print heading - print_heading($streditcategories); + echo "

"; + echo $streditcategories; + helpbutton("categories", $strcategories, "quiz"); + echo "

"; /// If data submitted, then process and store. diff --git a/mod/quiz/lib.php b/mod/quiz/lib.php index 8118abfdc31..dd61b9adb3d 100644 --- a/mod/quiz/lib.php +++ b/mod/quiz/lib.php @@ -641,6 +641,7 @@ function quiz_print_cat_question_list($categoryid) { choose_from_menu($QUIZ_QUESTION_TYPE, "type", "", ""); echo "id\">"; echo ""; + helpbutton("questiontypes", $strcreatenewquestion, "quiz"); echo ""; echo ""; @@ -937,7 +938,7 @@ function quiz_grade_attempt_results($quiz, $questions) { switch ($question->type) { case SHORTANSWER: if ($question->answer) { - $question->answer = $question->answer[0]; + $question->answer = trim($question->answer[0]); } else { $question->answer = ""; } diff --git a/mod/quiz/mod.html b/mod/quiz/mod.html index cf7d45e78db..8b2fe04b9d4 100644 --- a/mod/quiz/mod.html +++ b/mod/quiz/mod.html @@ -28,6 +28,7 @@ } print_date_selector("openday", "openmonth", "openyear", $form->timeopen); print_time_selector("openhour", "openminute", $form->timeopen); + helpbutton("timeopen", get_string("quizopen","quiz"), "quiz"); ?> @@ -40,6 +41,7 @@ } print_date_selector("closeday", "closemonth", "closeyear", $form->timeclose); print_time_selector("closehour", "closeminute", $form->timeclose); + helpbutton("timeopen", get_string("quizclose","quiz"), "quiz"); ?> @@ -53,6 +55,7 @@ $options[$i] = "$i ".strtolower(get_string("attempts", "quiz")); } choose_from_menu($options, "attempts", "$form->attempts", ""); + helpbutton("attempts", get_string("attemptsallowed","quiz"), "quiz"); ?> @@ -66,6 +69,7 @@ $options[3] = get_string("attemptfirst", "quiz"); $options[4] = get_string("attemptlast", "quiz"); choose_from_menu($QUIZ_GRADE_METHOD, "grademethod", "$form->grademethod", ""); + helpbutton("grademethod", get_string("grademethod","quiz"), "quiz"); ?> @@ -77,6 +81,7 @@ $options[0] = get_string("no"); $options[1] = get_string("yes"); choose_from_menu($options, "feedback", "$form->feedback", ""); + helpbutton("feedback", get_string("showfeedback","quiz"), "quiz"); ?> @@ -88,6 +93,7 @@ $options[0] = get_string("no"); $options[1] = get_string("yes"); choose_from_menu($options, "correctanswers", "$form->correctanswers", ""); + helpbutton("correctanswers", get_string("showcorrectanswer","quiz"), "quiz"); ?> @@ -99,6 +105,7 @@ $grades[$i] = $i; } choose_from_menu($grades, "grade", "$form->grade", ""); + helpbutton("maxgrade", get_string("maximumgrade"), "quiz"); ?> diff --git a/mod/quiz/question.php b/mod/quiz/question.php index aa97b2ad716..1533c84cf25 100644 --- a/mod/quiz/question.php +++ b/mod/quiz/question.php @@ -248,7 +248,7 @@ case SHORTANSWER: $options = get_record("quiz_shortanswer", "question", "$question->id");// OK to fail $answersraw = get_records_list("quiz_answers", "id", "$options->answers");// OK to fail - print_heading(get_string("editingshortanswer", "quiz")); + print_heading_with_help(get_string("editingshortanswer", "quiz"), "shortanswer", "quiz"); if ($answersraw) { foreach ($answersraw as $answer) { $answers[] = $answer; // to renumber index 0,1,2... @@ -266,7 +266,7 @@ } else { $question->answer = 0; } - print_heading(get_string("editingtruefalse", "quiz")); + print_heading_with_help(get_string("editingtruefalse", "quiz"), "truefalse", "quiz"); require("truefalse.html"); break; @@ -278,13 +278,14 @@ $answers[] = $answer; // to renumber index 0,1,2... } } - print_heading(get_string("editingmultichoice", "quiz")); + print_heading_with_help(get_string("editingmultichoice", "quiz"), "multichoice", "quiz"); require("multichoice.html"); break; - case RANDOM: - print_heading("Sorry, random questions are not supported yet"); - print_continue("edit.php"); - break; + + case RANDOM: + print_heading_with_help(get_string("editingrandom", "quiz"), "random", "quiz"); + print_continue("edit.php"); + break; default: error("Invalid question type"); diff --git a/mod/quiz/report.php b/mod/quiz/report.php index 22b667a8a49..ac1b9d10e06 100644 --- a/mod/quiz/report.php +++ b/mod/quiz/report.php @@ -116,6 +116,9 @@ $users = array(); foreach ($attempts as $attempt) { + if (!$attempt->timefinish) { // Skip incomplete attempts + continue; + } if (! $questions = quiz_get_attempt_responses($attempt)) { error("Could not reconstruct quiz results for attempt $attempt->id!"); }