diff --git a/bolt_checkin_notes.txt b/bolt_checkin_notes.txt
index 5dd4ad31c6..fea18b94fd 100644
--- a/bolt_checkin_notes.txt
+++ b/bolt_checkin_notes.txt
@@ -259,3 +259,15 @@ David Oct 24 2008
bolt.css
bolt_admin.css
bolt_sched.php
+
+David Oct 30 2008
+ - added "fill in the blank" (FITB) exercise type
+ - added "has_answer_page()" option for exercises
+
+ html/
+ inc/
+ bolt_ex.inc
+ bolt.inc
+ user/
+ bolt.css
+ bolt_sched.php
diff --git a/checkin_notes b/checkin_notes
index b55ef17a73..b79322e0dc 100644
--- a/checkin_notes
+++ b/checkin_notes
@@ -8901,3 +8901,15 @@ Charlie 30 Oct 2008
clientgui/
BOINCBaseFrame.cpp, .h
BOINCGUIApp.cpp
+
+David 30 Oct 2008
+ - web: change style sheet so tables are bordered only if class is "bordered"
+ - web: fix error if translation string missing
+
+ html/
+ inc/
+ util.inc
+ translation.inc
+ user/
+ language_select.php
+ white.css
diff --git a/doc/index.php b/doc/index.php
index dd41bf4144..8c03ab6389 100644
--- a/doc/index.php
+++ b/doc/index.php
@@ -21,9 +21,8 @@ function show_participant() {
diff --git a/html/inc/bolt.inc b/html/inc/bolt.inc
index 51af2e2da6..5a19084078 100644
--- a/html/inc/bolt.inc
+++ b/html/inc/bolt.inc
@@ -80,10 +80,15 @@ class BoltExercise extends BoltItem {
public $callback;
// called as func($student, $score, $query_string) after scoring
public $weight;
- function __construct($filename, $title, $attrs, $callback, $weight) {
+ public $has_answer_page;
+
+ function __construct(
+ $filename, $title, $attrs, $callback, $weight, $has_answer_page
+ ) {
parent::__construct($filename, $title, $attrs);
$this->callback = $callback;
$this->weight = $weight;
+ $this->has_answer_page = $has_answer_page;
}
function is_exercise() {
return true;
@@ -257,6 +262,10 @@ function filename($n) {
return array('filename', $n);
}
+function has_answer_page($n) {
+ return array('has_answer_page', $n);
+}
+
function attrs($n) {
return array('attrs', $n);
}
@@ -297,6 +306,7 @@ function exercise() {
$title = "";
$attrs = null;
$weight = 1;
+ $has_answer_page = true;
$args = func_get_args();
$callback = null;
@@ -308,6 +318,7 @@ function exercise() {
case 'attrs': $attrs = $arg[1]; break;
case 'callback': $callback = $arg[1]; break;
case 'weight': $weight = $arg[1]; break;
+ case 'has_answer_page': $has_answer_page = $arg[1]; break;
default: echo "Unrecognized exercise parameter: ", $arg[0], "\n"; break;
}
}
@@ -318,7 +329,9 @@ function exercise() {
if (!$filename) {
error_page("Missing filename in lesson");
}
- return new BoltExercise($filename, $title, $attrs, $callback, $weight);
+ return new BoltExercise(
+ $filename, $title, $attrs, $callback, $weight, $has_answer_page
+ );
}
function item_attrs() {
diff --git a/html/inc/bolt_ex.inc b/html/inc/bolt_ex.inc
index 16ad15e414..78cd5622d5 100644
--- a/html/inc/bolt_ex.inc
+++ b/html/inc/bolt_ex.inc
@@ -27,15 +27,8 @@ $bolt_ex->score = 0; // input/output: cumulative score (if mode = SCORE)
$bolt_ex->weight = 0; // input/output: cumulative weight
$bolt_ex->query_string = ""; // user's response (if SCORE or ANSWER)
-class BoltWeight {
- public $weight;
- function __construct($weight) {
- $this->weight = $weight;
- }
-}
-
function weight($w) {
- return new BoltWeight($w);
+ return array('weight', $w);
}
function exclusive_choice() {
@@ -47,14 +40,13 @@ function exclusive_choice() {
foreach ($args as $arg) {
if (is_string($arg)) {
$choices[] = $arg;
- } else if (is_object($arg)) {
- if (get_class($arg) == 'BoltWeight') {
- $weight = $arg->weight;
- } else {
- "bad arg to exclusive_choice()";
+ } else if (is_array($arg)) {
+ switch ($arg[0]) {
+ case 'weight': $weight = $arg[1]; break;
+ default: echo "bad arg to exclusive_choice()";
}
} else {
- "bad arg to exclusive_choice()";
+ echo "bad arg to exclusive_choice()";
}
}
@@ -129,10 +121,10 @@ function inclusive_choice() {
if (get_class($arg) == 'BoltWeight') {
$weight = $arg->weight;
} else {
- "bad arg to inclusive_choice()";
+ echo "bad arg to inclusive_choice()";
}
} else {
- "bad arg to inclusive_choice()";
+ echo "bad arg to inclusive_choice()";
}
}
@@ -197,8 +189,7 @@ function image_rect($img, $rect) {
switch ($bolt_ex->mode) {
case BOLT_MODE_SHOW:
- echo " |