";
+}
+
//////////// show refresh schedule //////////////
function show_refresh($r) {
@@ -460,4 +485,10 @@ function show_refreshes() {
end_table();
}
+function bolt_style() {
+ echo "
+
+ ";
+}
+
?>
diff --git a/html/inc/util.inc b/html/inc/util.inc
index cfac014b09..3ccb03ca3b 100644
--- a/html/inc/util.inc
+++ b/html/inc/util.inc
@@ -25,6 +25,7 @@ require_once("../inc/translation.inc");
require_once("../inc/profile.inc");
ini_set("memory_limit", "64M");
+
date_default_timezone_set("UTC");
$generating_xml = false;
diff --git a/html/user/bolt_compare.php b/html/ops/bolt_compare.php
similarity index 98%
rename from html/user/bolt_compare.php
rename to html/ops/bolt_compare.php
index d6278f134c..2d0358b179 100644
--- a/html/user/bolt_compare.php
+++ b/html/ops/bolt_compare.php
@@ -31,6 +31,7 @@
require_once("../inc/util.inc");
require_once("../inc/bolt_db.inc");
require_once("../inc/bolt_util.inc");
+require_once("../inc/bolt.inc");
require_once("../inc/bolt_cat.inc");
function compare_case(
@@ -82,7 +83,7 @@ function compare_aux($select_name, $xset_name, $snap) {
global $course_id;
$breakdown_name = get_str('breakdown', true);
- if ($breakdown_name) {
+ if ($breakdown_name && $breakdown_name != 'none') {
$breakdown = lookup_categorization($breakdown_name);
if (!$breakdown) error_page("unknown breakdown $breakdown_name");
} else {
@@ -180,7 +181,7 @@ function show_snap_form($top_unit) {
Create a new snapshot using data from the last
- days.
+ days.
";
diff --git a/html/ops/bolt_datagen.php b/html/ops/bolt_datagen.php
index 7af78dcc0b..8405cc98e3 100644
--- a/html/ops/bolt_datagen.php
+++ b/html/ops/bolt_datagen.php
@@ -16,10 +16,13 @@
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see .
-// generate synthetic usage data for a Bolt course (for debugging analytics)
+// Generate synthetic usage data for a Bolt course (for debugging analytics),
+// or to clear out existing data.
+// See comments below for how to use this.
require_once("../inc/bolt_db.inc");
require_once("../inc/bolt_util.inc");
+require_once("../inc/bolt.inc");
require_once("../inc/bolt_cat.inc");
// generate a random student
@@ -67,7 +70,7 @@ function compare_gen(
$a2, $d2 // avg and dev of score for chosen alternative
) {
global $course;
- $top_unit = require_once("../user/$course->doc_file");
+ $top_unit = require_once($course->doc_file());
$select_unit = lookup_unit($top_unit, $select_name);
if (!$select_unit) error_page("no such select unit");
if (!lookup_unit($top_unit, $xset_name)) error_page("no such xset");
@@ -104,7 +107,7 @@ function compare_gen(
function map_gen($n, $sb1, $sb2, $sel, $sel_cat) {
global $course;
- $top_unit = require_once("../user/$course->doc_file");
+ $top_unit = require_once($course->doc_file());
for ($i=0; $i<$n; $i++) {
$uid = random_student();
$user = BoincUser::lookup_id($uid);
@@ -191,7 +194,9 @@ function clear() {
$db->do_query("delete from DBNAME.bolt_select_finished where course_id=$course->id");
}
-$course = BoltCourse::lookup_id(2);
+// put your course ID here:
+
+$course = BoltCourse::lookup_id(4);
if (!$course) error_page("no such course");
$now = time();
@@ -201,7 +206,12 @@ if (1) {
if (0) {
compare_gen(
- 'sample select', 'exercise set 1', 10, .5, .1, 'lesson 1', .8, .1
+ 'Conifer/deciduous alternative', // select name
+ 'Intro exercises', // xset name
+ 50, // # of records to create
+ .5, .1, // mean and dev of default score
+ 'conifer_decid2.php', // name of chosen alternative
+ .8, .1 // mean and dev of score for that alternative
);
}
diff --git a/html/ops/bolt_map.php b/html/ops/bolt_map.php
index 1d53397ec2..1f157d6f17 100644
--- a/html/ops/bolt_map.php
+++ b/html/ops/bolt_map.php
@@ -50,9 +50,6 @@ require_once("../inc/bolt_cat.inc");
require_once("../inc/bolt_util.inc");
require_once("../inc/bolt.inc");
-echo "
-
-";
// the following are to minimize argument passing
$snap = null;
@@ -87,7 +84,7 @@ function show_snap_form() {
Create a new snapshot using data from the last
- days.
+ days.
";
@@ -167,6 +164,7 @@ function outcomes($views) {
switch ($v->action) {
case BOLT_ACTION_NONE: $x[0]++; break;
case BOLT_ACTION_NEXT: $x[1]++; break;
+ case BOLT_ACTION_SUBMIT: $x[1]++; break;
default: $x[2]++; break;
}
}
@@ -215,11 +213,15 @@ function class_name($class) {
}
}
+$rownum = 0;
+
function show_unit_row($unit, $class, $level, $is_answer) {
global $breakdown, $breakdown_cat;
+ global $rownum;
$a = $is_answer?" (answer)":"";
- echo "