- web: fix broken link for profile like/don't like.

TODO: currently these don't do anything useful.  Fix this.

svn path=/trunk/boinc/; revision=14461
This commit is contained in:
David Anderson 2008-01-03 17:37:38 +00:00
parent 57f0bbc6e5
commit 2d40b5722d
5 changed files with 49 additions and 18 deletions

View File

@ -69,3 +69,10 @@ David Jan 3 2008
update_profile_pages.php
tools/
make_project
David Jan 3 2008
- web: fix broken link for profile like/don't like.
TODO: currently these don't do anything useful. Fix this.
html/inc/
profile.inc

View File

@ -69,23 +69,41 @@ create table bolt_exercise_result (
primary key(id)
);
-- represents the result of an exercise set
-- represents the result of a completed exercise set,
-- where "completed" means the student clicked Next on the final answer page.
-- This is slightly redundant -
-- it could be reconstructed from the individual exercise results -
-- but this way makes it easier for analytics to treat exercise sets as units.
--
create table bolt_exercise_set_result (
create table bolt_xset_result (
id integer not null auto_increment,
create_time integer not null,
user_id integer not null,
course_id integer not null,
name varchar(255) not null,
-- logical name of result set unit
score double not null,
view_id integer not null,
-- the answer page of last exercise in set
name varchar(255) not null,
-- logical name of result set unit
primary key(id)
);
-- represents a refresh/repeat of an exercise set,
-- either pending (not due yet),
-- due but not started, or in progress.
--
create table bolt_refresh (
id integer not null auto_increment,
create_time integer not null,
user_id integer not null,
course_id integer not null,
name varchar(255) not null,
-- logical name of result set unit
last_view_id integer not null,
-- if refresh is in progress, the last view
set_result_id integer not null,
-- most recent result for this set
due_time integer not null,
-- when to trigger review
-- when refresh will be due
primary key (id)
);

View File

@ -15,10 +15,7 @@ class BoltExerciseSet extends BoltUnit {
// the scheduler calls this when an exercise in this set
// has just been graded.
// - record the score
// - if this is the last exercise in the set,
// create exercise_set_result record
// and optionally create or update bolt_refresh record
// - record the score in our state structure
// - return a structure saying what navigation info to show:
// - review
// - repeat now
@ -28,13 +25,22 @@ class BoltExerciseSet extends BoltUnit {
$state_rec = $iter->state[$this->name];
$number_shown = $state_rec['number_shown'];
$state_rec['scores'][$number_shown] = $score;
if ($number_shown == $this->number) {
$is_last = false;
return;
$is_last = ($number_shown == $this->number);
if ($is_last) {
} else {
}
$is_last = true;
BoincResult::insert("");
BoincRefresh::replace("");
}
// The user clicked "Next" on last answer page,
// so this exercise set is now "completed".
// - create exercise_set_result record
// - optionally create or update bolt_refresh record
//
function completed($score, $view_id) {
$now = time();
$id = BoincXsetResult::insert("(create_time, user_id, course_id, name, score, view_id) values ($now, $user->id, $course->id, '$this->name', $score, $view_id)");
$due_time = $now + 100000;
BoincRefresh::replace("create_time=$now, user_id=$user->id, course_id=$course->id, name='$this->name', set_result_id=$id, due_time=$due_time");
}
function walk(&$iter, $incr, &$frac_done) {

View File

@ -228,11 +228,11 @@ function show_profile($user, $logged_in_user, $screen_mode = false) {
row1("Your feedback on this profile");
row2(
"Recommend this profile for User of the Day:",
"I <a href=profile_rate.php?userid=$userid&vote=recommend>like</a> this profile"
"I <a href=profile_rate.php?userid=$user->id&vote=recommend>like</a> this profile"
);
row2(
"Alert administrators to an offensive profile:",
"I <a href=profile_rate.php?userid=$userid&vote=reject>don't like</a> this profile"
"I <a href=profile_rate.php?userid=$user->id&vote=reject>don't like</a> this profile"
);
}
}

View File

@ -75,7 +75,7 @@ function create_view($user, $course, $iter, $mode, $prev_view_id) {
function show_finished_page($course, $view_id, $prev_view_id) {
page_head(null);
if (function_exists('bolt_header')) bolt_header("Course completed");
echo "Congratulation - you have completed this course.";
echo "Congratulations - you have completed this course.";
$prev = "<a href=bolt_sched.php?course_id=$course->id&action=prev&view_id=$view_id><< Prev</a>";
echo "
<p>