diff --git a/.gitignore b/.gitignore
index d38424211..68b3090a0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,8 +8,13 @@ htdocs/tmp/*
tmp/*
logs/*
conf/*.conf
+conf/*apache-config
conf/*.apache2-config
htdocs/site_info.txt
bin/wwapache2ctl
webwork2.komodoproject
#courses.dist/*
+node_modules
+node_modules/*
+WeBWorK.sublime-project
+WeBWorK.sublime-workspace
diff --git a/.gitmodules b/.gitmodules
index 1c418bb5a..8b1378917 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +1 @@
-[submodule "htdocs/mathjax"]
- path = htdocs/mathjax
- url = https://github.com/mathjax/MathJax.git
+
diff --git a/VERSION b/VERSION
index 628de6c59..31b0c8f2d 100644
--- a/VERSION
+++ b/VERSION
@@ -1,3 +1,4 @@
-$WW_VERSION ='2.5.1.3';
+$WW_VERSION ='development';
$WW_COPYRIGHT_YEARS = '1996-2013';
+
1;
diff --git a/bin/OPL-update b/bin/OPL-update
index b55f40619..dc5071b8e 100755
--- a/bin/OPL-update
+++ b/bin/OPL-update
@@ -26,6 +26,8 @@ use DBI;
BEGIN {
die "WEBWORK_ROOT not found in environment.\n"
unless exists $ENV{WEBWORK_ROOT};
+ # Unused variable, but define it to avoid an error message.
+ $WeBWorK::Constants::WEBWORK_DIRECTORY = '';
}
### Data for creating the database tables
@@ -44,6 +46,8 @@ my %OPLtables = (
chapter => 'OPL_chapter',
section => 'OPL_section',
problem => 'OPL_problem',
+ morelt => 'OPL_morelt',
+ morelt_pgfile => 'OPL_morelt_pgfile',
pgfile_problem => 'OPL_pgfile_problem',
);
@@ -61,6 +65,8 @@ my %NPLtables = (
chapter => 'NPL-chapter',
section => 'NPL-section',
problem => 'NPL-problem',
+ morelt => 'NPL-morelt',
+ morelt_pgfile => 'NPL-morelt-pgfile',
pgfile_problem => 'NPL-pgfile-problem',
);
@@ -156,6 +162,7 @@ if($libraryVersion eq '2.5') {
institution tinyblob,
path_id int(15) NOT NULL,
filename varchar(255) NOT NULL,
+ morelt_id int(15),
PRIMARY KEY (pgfile_id)
'],
[$tables{keyword}, '
@@ -209,6 +216,19 @@ if($libraryVersion eq '2.5') {
KEY (section_id),
PRIMARY KEY (problem_id)
'],
+[$tables{morelt}, '
+ morelt_id int(15) NOT NULL auto_increment,
+ name varchar(127) NOT NULL,
+ DBsection_id int(15),
+ leader int(15), # pgfile_id of the MLT leader
+ KEY (name),
+ PRIMARY KEY (morelt_id)
+'],
+[$tables{morelt_pgfile}, '
+ morelt_id int(15) DEFAULT 0 NOT NULL,
+ pgfile_id int(15) DEFAULT 0 NOT NULL,
+ PRIMARY KEY (morelt_id, pgfile_id)
+'],
[$tables{pgfile_problem}, '
pgfile_id int(15) DEFAULT 0 NOT NULL,
problem_id int(15) DEFAULT 0 NOT NULL,
@@ -414,6 +434,7 @@ sub pgfiles {
my $name = $File::Find::name;
my ($subject, $chapter, $section, $date, $institution, $author, $text);
my ($edition, $textauthor, $textsection, $textproblem, $tagged);
+ my ($morelt, $morelt_leader);
%textinfo=();
my @textproblems = (-1);
if ($name =~ /swf$/) {
@@ -431,42 +452,54 @@ sub pgfiles {
$tagged = 0;
while () {
SWITCH: {
- if (/\bKEYWORDS\((.*)\)/i) {
+ if (/#.*\bKEYWORDS\((.*)\)/i) {
@keyword = keywordcleaner($1);
last SWITCH;
}
- if (/\bDBsubject\s*\(\s*'?(.*?)'?\s*\)/) {
+ if (/#.*\bDBsubject\s*\(\s*'?(.*?)'?\s*\)/) {
$subject = $1;
$subject =~ s/'/\'/g;
last SWITCH;
}
- if (/\bDBchapter\s*\(\s*'?(.*?)'?\s*\)/) {
+ if (/#.*\bDBchapter\s*\(\s*'?(.*?)'?\s*\)/) {
$chapter = $1;
$chapter =~ s/'/\'/g;
$tagged = 1;
last SWITCH;
}
- if (/\bDBsection\s*\(\s*'?(.*?)'?\s*\)/) {
+ if (/#.*\bDBsection\s*\(\s*'?(.*?)'?\s*\)/) {
$section = $1;
$section =~ s/'/\'/g;
last SWITCH;
}
- if (/\bDate\s*\(\s*'(.*?)'\s*\)/) {
+ if (/#.*\bDate\s*\(\s*'(.*?)'\s*\)/) {
$date = $1;
$date =~ s/'/\'/g;
last SWITCH;
}
- if (/\bInstitution\s*\(\s*'(.*?)'\s*\)/) {
+ if (/#.*\bInstitution\s*\(\s*'(.*?)'\s*\)/) {
$institution = $1;
$institution =~ s/'/\'/g;
last SWITCH;
}
- if (/\bAuthor\(\s*'?(.*?)'?\s*\)/) {
+ if (/#.*\bAuthor\(\s*'?(.*?)'?\s*\)/) {
$author = $1;
$author =~ s/'/\'/g;
last SWITCH;
}
- if (/\bTitleText(\d+)\(\s*'?(.*?)'?\s*\)/) {
+ if (/#.*\bMLTleader\(\s*'?(.*?)'?\s*\)/) {
+ $morelt_leader = $1;
+ $morelt_leader =~ s/['"]//g;
+ $morelt_leader= ($morelt_leader =~ /\S/) ? 1 : 0;
+ last SWITCH;
+ }
+ if (/#.*\bMLT\(\s*'?(.*?)'?\s*\)/) {
+ $morelt = $1;
+ $morelt =~ s/'//g;
+ $morelt = lc($morelt);
+ last SWITCH;
+ }
+ if (/#.*\bTitleText(\d+)\(\s*'?(.*?)'?\s*\)/) {
$textno = $1;
$text = $2;
$text =~ s/'/\'/g;
@@ -476,7 +509,7 @@ sub pgfiles {
}
last SWITCH;
}
- if (/\bEditionText(\d+)\(\s*'?(.*?)'?\s*\)/) {
+ if (/#.*\bEditionText(\d+)\(\s*'?(.*?)'?\s*\)/) {
$textno = $1;
$edition = $2;
$edition =~ s/'/\'/g;
@@ -486,7 +519,7 @@ sub pgfiles {
}
last SWITCH;
}
- if (/\bAuthorText(\d+)\(\s*'?(.*?)'?\s*\)/) {
+ if (/#.*\bAuthorText(\d+)\(\s*'?(.*?)'?\s*\)/) {
$textno = $1;
$textauthor = $2;
$textauthor =~ s/'/\'/g;
@@ -496,7 +529,7 @@ sub pgfiles {
}
last SWITCH;
}
- if (/\bSection(\d+)\(\s*'?(.*?)'?\s*\)/) {
+ if (/#.*\bSection(\d+)\(\s*'?(.*?)'?\s*\)/) {
$textno = $1;
$textsection = $2;
$textsection =~ s/'/\'/g;
@@ -513,7 +546,7 @@ sub pgfiles {
}
last SWITCH;
}
- if (/\bProblem(\d+)\(\s*(.*?)\s*\)/) {
+ if (/#.*\bProblem(\d+)\(\s*(.*?)\s*\)/) {
$textno = $1;
$textproblem = $2;
$textproblem =~ s/\D/ /g;
@@ -537,6 +570,7 @@ sub pgfiles {
#
# kludge to fix the omission of a subject field
unless($subject) {
+print "NO SUBJECT $name\n";
if ($text =~ /precalculus/i) {
$subject = "Precalculus";
} elsif ($text =~ /calculus/i) {
@@ -570,6 +604,10 @@ sub pgfiles {
# in that file.
#
+ # Fill in missing data with Misc. instead of blank
+ $chapter = 'Misc.' unless $chapter =~ /\S/;
+ $section = 'Misc.' unless $section =~ /\S/;
+
#selectrow_array returns first field of first row in scalar context or undef
# undef for failure also, $dbh->{RaiseError} = 1 should catch that case.
#
@@ -672,13 +710,47 @@ sub pgfiles {
\"$author_id\",
\"$institution\",
\"$path_id\",
- \"$pgfile\"
+ \"$pgfile\",
+ \"\" # morelt_id filled in below
)"
);
dbug "INSERT INTO pgfile VALUES( \"\", \"$DBsection_id\", \"$author_id\", \"$institution\", \"$path_id\", \"$pgfile\", \"\" )\n";
$query = "SELECT pgfile_id FROM `$tables{pgfile}` WHERE filename = \"$pgfile\" and path_id=$path_id";
$pgfile_id = $dbh->selectrow_array($query);
+ # morelt table, and morelt_pgfile many-many table
+ if($morelt) {
+ $query = "SELECT morelt_id FROM `$tables{morelt}` WHERE name = \"$morelt\"";
+ $morelt_id = $dbh->selectrow_array($query);
+ if (!defined($morelt_id)) {
+ $dbh->do("INSERT INTO `$tables{morelt}`
+ VALUES(
+ \"\",
+ \"$morelt\",
+ \"$DBsection_id\",
+ \"\"
+ )");
+ dbug "INSERT INTO morelt VALUES( \"\", \"$morelt\", \"$pgfile_id\" )\n";
+ }
+ $morelt_id = $dbh->selectrow_array($query);
+ $dbh->do("UPDATE `$tables{pgfile}` SET
+ morelt_id = \"$morelt_id\"
+ WHERE pgfile_id = \"$pgfile_id\" "
+ );
+ dbug "UPDATE pgfile morelt_id for $pgfile_id to $morelt_id\n";
+ if($morelt_leader) {
+ $dbh->do("UPDATE `$tables{morelt}` SET
+ leader = \"$pgfile_id\"
+ WHERE morelt_id = \"$morelt_id\" "
+ );
+ dbug "UPDATE morelt leader for $morelt_id to $pgfile_id\n";
+ }
+ $dbh->do("INSERT INTO `$tables{morelt_pgfile}`
+ VALUES(\"$morelt_id\", \"$pgfile_id\")");
+ dbug "INSERT INTO `$tables{morelt_pgfile}`
+ VALUES($morelt_id, $pgfile_id)";
+ }
+
# keyword table, and problem_keyword many-many table
#
foreach my $keyword (@keyword) {
diff --git a/conf/database.conf.dist b/conf/database.conf.dist
index 3e36baeba..72ba0327b 100644
--- a/conf/database.conf.dist
+++ b/conf/database.conf.dist
@@ -286,7 +286,8 @@ $dbLayouts{sql_single} = {
source => $database_dsn,
params => { %sqlParams,
tableOverride => "${courseName}_achievement"
-
+ },
+ },
past_answer => {
record => "WeBWorK::DB::Record::PastAnswer",
schema => "WeBWorK::DB::Schema::NewSQL::Std",
@@ -297,7 +298,6 @@ $dbLayouts{sql_single} = {
},
},
-
achievement_user => {
record => "WeBWorK::DB::Record::UserAchievement",
schema => "WeBWorK::DB::Schema::NewSQL::Std",
diff --git a/conf/defaults.config b/conf/defaults.config
index 3afe7dcac..9756d46df 100644
--- a/conf/defaults.config
+++ b/conf/defaults.config
@@ -472,14 +472,22 @@ my $achievementTablesExist = (defined ($dbLayouts{$dbLayoutName}{global_user_ach
################################################################################
# Problem library options
################################################################################
+#
+# The problemLibrary configuration data should now be set in localOverrides.conf
# For configuration instructions, see:
# http://webwork.maa.org/wiki/National_Problem_Library
-# Set the location of the library in site.conf
-# These values usually do not need to be edited.
-
-# Problem Library version (currently version 2).
-$problemLibrary{version} = "2";
+# The directory containing the natinal problem library files.
+# Set the root to "" if no problem
+# library is installed. Use version 2.0 for the NPL and use the version 2.5 for the OPL.
+# When changing from the NPL to the OPL it is important to change the version number
+# because the names of the tables in the database have changed.
+
+#RE-CONFIGURE problemLibrary values in localOverrides.conf
+#################################################
+$problemLibrary{root} ="/opt/webwork/libraries/webwork-open-problem-library/OpenProblemLibrary";
+$problemLibrary{version} ="2.0"; # 2.0 for NPL, 2.5 for OPL
+###########################################################
# Problem Library SQL database connection information
$problemLibrary_db = {
@@ -623,6 +631,7 @@ $authen{proctor_module} = "WeBWorK::Authen::Proctor";
edit_achievements => "professor",
create_and_delete_courses => "professor",
fix_course_databases => "professor",
+ modify_tags => undef,
##### Behavior of the interactive problem processor #####
@@ -1314,4 +1323,5 @@ A value such as 0.1 means 0.1 percent error is allowed.",
include("conf/localOverrides.conf");
+
1; #final line of the file to reassure perl that it was read properly.
diff --git a/conf/localOverrides.conf.dist b/conf/localOverrides.conf.dist
index e3ae1f642..980500a4c 100644
--- a/conf/localOverrides.conf.dist
+++ b/conf/localOverrides.conf.dist
@@ -90,15 +90,20 @@ $webworkFiles{screenSnippets}{setHeader} = "$webworkDirs{conf}/snippets/
################################################################################
-# National Problem Library
+# National Problem Library / Open Problem Library
################################################################################
# For configuration instructions, see:
# http://webwork.maa.org/wiki/National_Problem_Library
-# The directory containing the natinal problem library files. Set to "" if no problem
-# library is installed.
-$problemLibrary{root} ="/opt/webwork/libraries/NationalProblemLibrary";
+# The directory containing the natinal problem library files.
+# Set the root to "" if no problem
+# library is installed. Use version 2.0 for the NPL and use the version 2.5 for the OPL.
+# When changing from the NPL to the OPL it is important to change the version number
+* because the names of the tables in the database have changed.
+
+$problemLibrary{root} ="/opt/webwork/libraries/webwork-open-problem-library/OpenProblemLibrary";
+$problemLibrary{version} ="2.5";
# Additional library buttons can be added to the Library Browser (SetMaker.pm)
# by adding the libraries you want to the following line. For each key=>value
@@ -152,9 +157,14 @@ $courseFiles{problibs} = {
# $permissionLevels{login} = "guest";
+
# The above code would give the permission to login to any user with permission
# level guest or higher.
+$permissionLevels{dont_log_past_answers} = undef;
+#$permissionLevels{record_set_version_answers_when_acting_as_student} = "professor";
+#$permissionLevels{record_answers_when_acting_as_student} = "professor";
+
################################################################################
# PG subsystem options
################################################################################
@@ -246,6 +256,7 @@ $problemDefaults{max_attempts} = -1;
homeworkseteditor1 => 1,
# homeworkseteditor2 => 1,
#
+# librarybrowsernojs => 1,
librarybrowser1 => 1,
# librarybrowser2 => 1,
# librarybrowser3 => 1,
@@ -253,8 +264,10 @@ $problemDefaults{max_attempts} = -1;
pgproblemeditor1 => 1,
# pgproblemeditor2 => 1,
# pgproblemeditor3 => 1,
+
);
+
################################################################################
# Directory for temporary files
################################################################################
diff --git a/conf/site.conf.dist b/conf/site.conf.dist
index a9c4dfada..2b8b233d0 100644
--- a/conf/site.conf.dist
+++ b/conf/site.conf.dist
@@ -189,18 +189,26 @@ $mail{smtpSender} = ''; # e.g. 'webwork@yourserver.yourschool.edu'
# Seconds to wait before timing out when connecting to the SMTP server.
$mail{smtpTimeout} = 30;
+
################################################################################
# Problem library options
################################################################################
+#
+# The problemLibrary configuration data should now be set in localOverrides.conf
# For configuration instructions, see:
# http://webwork.maa.org/wiki/National_Problem_Library
-# The directory containing the WeBWorK Open Problem Library (OPL) files - typically
-# /opt/webwork/libraries/webwork-open-problem-library/OpenProblemLibrary
-# or for the older National Problem Library (NPL)
-# /opt/webwork/libraries/NationalProblemLibrary
-# Set to "" if no problem library is installed.
-$problemLibrary{root} = "";
+# The directory containing the natinal problem library files.
+# Set the root to "" if no problem
+# library is installed. Use version 2.0 for the NPL and use the version 2.5 for the OPL.
+# When changing from the NPL to the OPL it is important to change the version number
+# because the names of the tables in the database have changed.
+
+#CONFIGURE problemLibrary values in this file. These settings override defaults in default.config
+#################################################
+$problemLibrary{root} ="/opt/webwork/libraries/webwork-open-problem-library/OpenProblemLibrary";
+$problemLibrary{version} ="2.0"; # 2.0 for NPL, 2.5 for OPL
+###########################################################
################################################################################
#Time Zone
diff --git a/courses.dist/modelCourse/templates/achievements/TestCourse_achievements.axp b/courses.dist/modelCourse/templates/achievements/TestCourse_achievements.axp
deleted file mode 100644
index af4b4c3da..000000000
--- a/courses.dist/modelCourse/templates/achievements/TestCourse_achievements.axp
+++ /dev/null
@@ -1,62 +0,0 @@
-01_night_owl, Night Owl, secret, Finish a homework set between 12PM and 2AM., 10, , night_owl.at, night_owl.png,
-02_crack_o_dawn, Crack O' Dawn, secret, Finish a homework set between 5AM and 7AM., 10, , crack_o_dawn.at, crack_o_dawn.png,
-03_on_the_hour, Watching the Clock, secret, Finish a problem at the top of the hour., 10, , on_the_hour.at, on_the_hour.png,
-04_last_minute, Last Minute Math, secret, Complete a homework within 30 minutes of the due date., 10, , last_minute.at, last_minute.png,
-05_still_not_right, Its Still Not Right, secret, Input the exact same (incorrect) answer 10 times in a row., 5, , still_not_right.at, still_not_right.png,
-06_persistance, Persistence is not Futile, secret, Solve a problem after 20 incorrect submissions., 10, , persistance.at, persistance.png,
-07_super_persistance, Green Never Looked So Good, secret, Solve a problem after 100 incorrect submissions., 10, , super_persistance.at, super_persistance.png,
-08_super_speed_math, Careful Planning and Quick Fingers, secret, Spend less than 10 minutes entering answers to a homework set., 20, , super_speed_math.at, super_speed_math.png,
-09_hows_your_finger, Hows Your Finger?, secret, Have more than 250 submissions on a homework problem. , 10, , hows_your_finger.at, hows_your_finger.png,
-01_one_click, One Click Is All I Need, 01_one_timer, Earn 100% on a problem in one attempt., 10, , one_click.at, one_click.png,
-02_on_one_hand, On One Hand, 01_one_timer, Finish a homework set with less than 5 incorrect submissions., 10, , on_one_hand.at, on_one_hand.png,
-03_seeing_green, Seeing Green, 01_one_timer, Finish a homework set with no incorrect submissions., 20, , seeing_green.at, seeing_green.png,
-04_early_bird, The Early Bird, 01_one_timer, Finish a homework set within 24 hours of it opening., 10, , early_bird.at, early_bird.png,
-05_really_early_bird, The Really Early Bird, 01_one_timer, Finish a homework set within 2 hours of it opening., 20, , really_early_bird.at, really_early_bird.png,
-06_back_for_more, Back For More, 01_one_timer, Retry a problem after a 8 hour break., 10, , back_for_more.at, back_for_more.png,
-07_chipping_away, Just Keep Chipping Away, 01_one_timer, Work on a single homework set over the course of 48 hours., 10, , chipping_away.at, chipping_away.png,
-08_speed_mather, Go Speed Math-er, 01_one_timer, Spend less than 1 hour working on a homework set., 10, , speed_mather.at, speed_mather.png,
-09_three_in_a_row, Three in a Row, 01_one_timer, Complete 3 problems in a row with no incorrect answers., 10, 3, three_in_a_row.at, one_click.png,
-10_on_fire, Your on Fire!, 01_one_timer, Complete 10 problems in a row with no incorrect answers., 20, 10, on_fire.at, on_fire.png,
-01_reaching_a_limit, Reaching a Limit, 02_content, Solve 10 basic limit problems., 10, 10, reaching_a_limit.at, reaching_a_limit.png,
-02_by_definition, By Definition, 02_content, Evaluate a derivative using the limit definition., 10, , by_definition.at, by_definition.png,
-03_derivative_master, Derivative Master, 02_content, Solve 30 basic derivatives., 20, 30, derivative_master.at, derivative_master.png,
-04_optimizer_prime, Optimizer Prime, 02_content, Solve a particularly hard optimization problem., 10, , optimizer_prime.at, optimizer_prime.png,
-05_its_all_relative, Its All Relative, 02_content, Solve a particularly hard related rates problem., 10, , its_all_relative.at, its_all_relative.png,
-06_pattern_recognition, Pattern Recognition, 02_content, Find the nth derivative of a function., 10, , pattern_recognition.at, pattern_recognition.png,
-07_the_lhopital, Take me to the L'Hopital, 02_content, Use L'Hopital's Rule to evaluate a limit., 10, , the_lhopital.at, the_lhopital.png,
-08_the_fundamentals, Covering the Fundamentals, 02_content, Use the Fundamental Theorem of Calculus., 10, , the_fundamentals.at, the_fundamentals.png,
-09_curvy_geometry, Curvy Geometry, 02_content, Find the area between two curves., 10, , curvy_geometry.at, curvy_geometry.png,
-10_doing_it_backwards, Doing It Backwards, 02_content, Solve 5 u-substitution problems., 10, 5, doing_it_backwards.at, doing_it_backwards.png,
-01_complete_one_set, One Set Wonder, 03_complete_sets, Get 100% on one homework set., 10, , complete_one_set.at, complete_one_set.png,
-02_complete_five_sets, High Five, 03_complete_sets, Get 100% on five homework sets., 10, 5, complete_five_sets.at, complete_five_sets.png,
-03_complete_ten_sets, One For Each Finger, 03_complete_sets, Get 100% on ten homework sets., 10, 10, complete_ten_sets.at, complete_ten_sets.png,
-04_complete_twenty_sets, Mathbox Twenty, 03_complete_sets, Get 100% on twenty homework sets., 20, 20, complete_twenty_sets.at, complete_twenty_sets.png,
-05_complete_thirty_sets, The Long Road, 03_complete_sets, Get 100% on thirty homework sets., 20, 30, complete_thirty_sets.at, complete_thirty_sets.png,
-06_complete_all_sets, Perfection, 03_complete_sets, Get 100% on all homework sets., 30, 35, complete_all_sets.at, complete_all_sets.png,
-01_challenge_one, Challenge One Complete, 04_challenge, Finish the first challenge problem., 10, , challenge_one.at, challenge_one.png,
-02_challenge_two, Challenge Two Complete, 04_challenge, Finish the second challenge problem., 10, , challenge_two.at, challenge_two.png,
-03_challenge_three, Challenge Three Complete, 04_challenge, Finish the third challenge problem., 10, , challenge_three.at, challenge_three.png,
-04_challenge_four, Challenge Four Complete, 04_challenge, Finish the fourth challenge problem., 10, , challenge_four.at, challenge_four.png,
-05_challenge_five, Challenge Five Complete, 04_challenge, Finish the fifth challenge problem., 10, , challenge_five.at, challenge_five.png,
-06_challenge_six, Challenge Six Complete, 04_challenge, Finish the sixth challenge problem., 10, , challenge_six.at, challenge_six.png,
-07_challenge_seven, Challenge Seven Complete, 04_challenge, Finish the seventh challenge problem., 10, , challenge_seven.at, challenge_seven.png,
-08_challenge_eight, Challenge Eight Complete, 04_challenge, Finish the eighth challenge problem., 10, , challenge_eight.at, challenge_eight.png,
-09_challenge_nine, Challenge Nine Complete, 04_challenge, Finish the ninth challenge problem., 10, , challenge_nine.at, challenge_nine.png,
-10_challenge_ten, Challenge Ten Complete, 04_challenge, Finish the tenth challenge problem., 10, , challenge_ten.at, challenge_ten.png,
-11_challenger, Challenger, 04_challenge, Finish all of the challenge problems., 10, 20, challenger.at, challenger.png,
-01_complete_one_problem, The First Step, 05_complete_problems, Earn 100% on a homework problem., 10, , complete_one_problem.at, complete_one_problem.png,
-02_complete_10_problems, Perfect 10, 05_complete_problems, Earn 100% on 10 homework problems., 10, 10, complete_10_problems.at, complete_10_problems.png,
-03_complete_25_problems, Twenty-Five Questions, 05_complete_problems, Earn 100% on 25 homework problems., 10, 25, complete_25_problems.at, complete_25_problems.png,
-04_complete_50_problems, 50 Ways to Solve a Math Problem, 05_complete_problems, Earn 100% on 50 homework problems., 10, 50, complete_50_problems.at, complete_50_problems.png,
-05_complete_100_problems, Seeing Benjamins, 05_complete_problems, Earn 100% on 100 homework problems., 20, 100, complete_100_problems.at, complete_100_problems.png,
-06_complete_150_problems, Sesqui-Centeni-Problems, 05_complete_problems, Earn 100% on 150 homework problems., 20, 150, complete_150_problems.at, complete_150_problems.png,
-01_level_one, Level 1 Calculus Initiate, level, , , , level_one.at, level_one.png,
-02_level_two, Level 2 Calculus Novice, level, , , , level_two.at, level_two.png,
-03_level_three, Level 3 Calculus Apprentice, level, , , , level_three.at, level_three.png,
-04_level_four, Level 4 Calculus Journeyman, level, , , , level_four.at, level_four.png,
-05_level_five, Level 5 Calculus Fellowcraft, level, , , , level_five.at, level_five.png,
-06_level_six, Level 6 Calculus Adept, level, , , , level_six.at, level_six.png,
-07_level_seven, Level 7 Calculus Craftsman, level, , , , level_seven.at, level_seven.png,
-08_level_eight, Level 8 Calculus Artesian, level, , , , level_eight.at, level_eight.png,
-09_level_nine, Level 9 Calculus Specialist, level, , , , level_nine.at, level_nine.png,
-10_level_ten, Level 10 Calculus Professor, level, , , , level_ten.at, level_ten.png,
diff --git a/courses.dist/modelCourse/templates/achievements/add_anything.at b/courses.dist/modelCourse/templates/achievements/add_anything.at
deleted file mode 100644
index e637e74ca..000000000
--- a/courses.dist/modelCourse/templates/achievements/add_anything.at
+++ /dev/null
@@ -1,84 +0,0 @@
-#This problem checks to see if a particular problem from a list of valid
-# sets and problems has been solved. (You would edit this file to say which
-# sets and problems count.)
-
-#constants
-my %validproblems = (
- 'SetNameHere' => { #now you show which problems are valid like:
- '2' => 1,
- '1' => 1, }, #and put more sets here
- );
-
-#check and see if this problem was solved
-if ($validproblems{$problem->set_id} &&
- $validproblems{$problem->set_id}{$problem->problem_id} &&
- $problem->status == 1 &&
- $problem->num_correct == 1) {
- return 1;
- }
-
- return 0;
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/back_for_more.at b/courses.dist/modelCourse/templates/achievements/back_for_more.at
deleted file mode 100644
index 44bd66b4c..000000000
--- a/courses.dist/modelCourse/templates/achievements/back_for_more.at
+++ /dev/null
@@ -1,84 +0,0 @@
-#This checks to see if the student has worked on one problem after
-# an eight hour break
-
-# initialize the time thing
-
-$localData->{lastattempttime} = time() unless $localData->{lastattempttime};
-
-# check to see if problem was already previously finished, or if they started
-# a different problem
-# or if the time interval isn't long enough.
-if ($problem->num_correct > 1 ||
- $problem->set_id ne $localData->{lastset} ||
- $problem->problem_id ne $localData->{lastproblem} ||
- abs($localData->{lastattempttime} - time()) < 28800 ){
- $localData->{lastattempttime} = time();
- $localData->{lastset} = $problem->set_id;
- $localData->{lastproblem} = $problem->problem_id;
- return 0;
-} else {
- return 1;
-}
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/by_definition.at b/courses.dist/modelCourse/templates/achievements/by_definition.at
deleted file mode 100644
index e637e74ca..000000000
--- a/courses.dist/modelCourse/templates/achievements/by_definition.at
+++ /dev/null
@@ -1,84 +0,0 @@
-#This problem checks to see if a particular problem from a list of valid
-# sets and problems has been solved. (You would edit this file to say which
-# sets and problems count.)
-
-#constants
-my %validproblems = (
- 'SetNameHere' => { #now you show which problems are valid like:
- '2' => 1,
- '1' => 1, }, #and put more sets here
- );
-
-#check and see if this problem was solved
-if ($validproblems{$problem->set_id} &&
- $validproblems{$problem->set_id}{$problem->problem_id} &&
- $problem->status == 1 &&
- $problem->num_correct == 1) {
- return 1;
- }
-
- return 0;
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/challenge_eight.at b/courses.dist/modelCourse/templates/achievements/challenge_eight.at
deleted file mode 100644
index df90fb557..000000000
--- a/courses.dist/modelCourse/templates/achievements/challenge_eight.at
+++ /dev/null
@@ -1,84 +0,0 @@
-#This evaluator checks to see if a particular problem of a particular set has
-# been solved
-
-#constants
-my %validproblems = (
- 'Challenge' => {
- '8' => 1, }
- );
-
-#check and see if this problem was solved
-if ($validproblems{$problem->set_id} &&
- $validproblems{$problem->set_id}{$problem->problem_id} &&
- $problem->status == 1 &&
- $problem->num_correct == 1) {
- #update challenger counter
- $globalData->{challengerCounter}++;
- return 1;
- }
-
- return 0;
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/challenge_five.at b/courses.dist/modelCourse/templates/achievements/challenge_five.at
deleted file mode 100644
index d9887bdb8..000000000
--- a/courses.dist/modelCourse/templates/achievements/challenge_five.at
+++ /dev/null
@@ -1,84 +0,0 @@
-#This evaluator checks to see if a particular problem of a particular set has
-# been solved
-
-#constants
-my %validproblems = (
- 'Challenge' => {
- '5' => 1, }
- );
-
-#check and see if this problem was solved
-if ($validproblems{$problem->set_id} &&
- $validproblems{$problem->set_id}{$problem->problem_id} &&
- $problem->status == 1 &&
- $problem->num_correct == 1) {
- #update challenger counter
- $globalData->{challengerCounter}++;
- return 1;
- }
-
- return 0;
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/challenge_four.at b/courses.dist/modelCourse/templates/achievements/challenge_four.at
deleted file mode 100644
index ae60641b4..000000000
--- a/courses.dist/modelCourse/templates/achievements/challenge_four.at
+++ /dev/null
@@ -1,84 +0,0 @@
-#This evaluator checks to see if a particular problem of a particular set has
-# been solved
-
-#constants
-my %validproblems = (
- 'Challenge' => {
- '4' => 1, }
- );
-
-#check and see if this problem was solved
-if ($validproblems{$problem->set_id} &&
- $validproblems{$problem->set_id}{$problem->problem_id} &&
- $problem->status == 1 &&
- $problem->num_correct == 1) {
- #update challenger counter
- $globalData->{challengerCounter}++;
- return 1;
- }
-
- return 0;
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/challenge_nine.at b/courses.dist/modelCourse/templates/achievements/challenge_nine.at
deleted file mode 100644
index 3648dd255..000000000
--- a/courses.dist/modelCourse/templates/achievements/challenge_nine.at
+++ /dev/null
@@ -1,84 +0,0 @@
-#This evaluator checks to see if a particular problem of a particular set has
-# been solved
-
-#constants
-my %validproblems = (
- 'Challenge' => {
- '9' => 1, }
- );
-
-#check and see if this problem was solved
-if ($validproblems{$problem->set_id} &&
- $validproblems{$problem->set_id}{$problem->problem_id} &&
- $problem->status == 1 &&
- $problem->num_correct == 1) {
- #update challenger counter
- $globalData->{challengerCounter}++;
- return 1;
- }
-
- return 0;
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/challenge_one.at b/courses.dist/modelCourse/templates/achievements/challenge_one.at
deleted file mode 100644
index e2c2586c6..000000000
--- a/courses.dist/modelCourse/templates/achievements/challenge_one.at
+++ /dev/null
@@ -1,84 +0,0 @@
-#This problem checks to see if a particular problem of a particular set has
-# been solved
-
-#constants
-my %validproblems = (
- 'Challenge' => {
- '1' => 1, }
- );
-
-#check and see if this problem was solved
-if ($validproblems{$problem->set_id} &&
- $validproblems{$problem->set_id}{$problem->problem_id} &&
- $problem->status == 1 &&
- $problem->num_correct == 1) {
- #update challenger counter
- $globalData->{challengerCounter}++;
- return 1;
- }
-
- return 0;
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/challenge_seven.at b/courses.dist/modelCourse/templates/achievements/challenge_seven.at
deleted file mode 100644
index c09abd346..000000000
--- a/courses.dist/modelCourse/templates/achievements/challenge_seven.at
+++ /dev/null
@@ -1,84 +0,0 @@
-#This evaluator checks to see if a particular problem of a particular set has
-# been solved
-
-#constants
-my %validproblems = (
- 'Challenge' => {
- '7' => 1, }
- );
-
-#check and see if this problem was solved
-if ($validproblems{$problem->set_id} &&
- $validproblems{$problem->set_id}{$problem->problem_id} &&
- $problem->status == 1 &&
- $problem->num_correct == 1) {
- #update challenger counter
- $globalData->{challengerCounter}++;
- return 1;
- }
-
- return 0;
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/challenge_six.at b/courses.dist/modelCourse/templates/achievements/challenge_six.at
deleted file mode 100644
index 69f56d2b5..000000000
--- a/courses.dist/modelCourse/templates/achievements/challenge_six.at
+++ /dev/null
@@ -1,84 +0,0 @@
-#This evaluator checks to see if a particular problem of a particular set has
-# been solved
-
-#constants
-my %validproblems = (
- 'Challenge' => {
- '6' => 1, }
- );
-
-#check and see if this problem was solved
-if ($validproblems{$problem->set_id} &&
- $validproblems{$problem->set_id}{$problem->problem_id} &&
- $problem->status == 1 &&
- $problem->num_correct == 1) {
- #update challenger counter
- $globalData->{challengerCounter}++;
- return 1;
- }
-
- return 0;
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/challenge_ten.at b/courses.dist/modelCourse/templates/achievements/challenge_ten.at
deleted file mode 100644
index 9f3738dd6..000000000
--- a/courses.dist/modelCourse/templates/achievements/challenge_ten.at
+++ /dev/null
@@ -1,84 +0,0 @@
-#This evaluator checks to see if a particular problem of a particular set has
-# been solved
-
-#constants
-my %validproblems = (
- 'Challenge' => {
- '10' => 1, }
- );
-
-#check and see if this problem was solved
-if ($validproblems{$problem->set_id} &&
- $validproblems{$problem->set_id}{$problem->problem_id} &&
- $problem->status == 1 &&
- $problem->num_correct == 1) {
- #update challenger counter
- $globalData->{challengerCounter}++;
- return 1;
- }
-
- return 0;
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/challenge_three.at b/courses.dist/modelCourse/templates/achievements/challenge_three.at
deleted file mode 100644
index 12aa750fb..000000000
--- a/courses.dist/modelCourse/templates/achievements/challenge_three.at
+++ /dev/null
@@ -1,84 +0,0 @@
-#This evaluator checks to see if a particular problem of a particular set has
-# been solved
-
-#constants
-my %validproblems = (
- 'Challenge' => {
- '3' => 1, }
- );
-
-#check and see if this problem was solved
-if ($validproblems{$problem->set_id} &&
- $validproblems{$problem->set_id}{$problem->problem_id} &&
- $problem->status == 1 &&
- $problem->num_correct == 1) {
- #update challenger counter
- $globalData->{challengerCounter}++;
- return 1;
- }
-
- return 0;
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/challenge_two.at b/courses.dist/modelCourse/templates/achievements/challenge_two.at
deleted file mode 100644
index b82c300bd..000000000
--- a/courses.dist/modelCourse/templates/achievements/challenge_two.at
+++ /dev/null
@@ -1,84 +0,0 @@
-#This evaluator checks to see if a particular problem of a particular set has
-# been solved
-
-#constants
-my %validproblems = (
- 'Challenge' => {
- '2' => 1, }
- );
-
-#check and see if this problem was solved
-if ($validproblems{$problem->set_id} &&
- $validproblems{$problem->set_id}{$problem->problem_id} &&
- $problem->status == 1 &&
- $problem->num_correct == 1) {
- #update challenger counter
- $globalData->{challengerCounter}++;
- return 1;
- }
-
- return 0;
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/challenger.at b/courses.dist/modelCourse/templates/achievements/challenger.at
deleted file mode 100644
index d06c963ee..000000000
--- a/courses.dist/modelCourse/templates/achievements/challenger.at
+++ /dev/null
@@ -1,74 +0,0 @@
-# This is a "solved n problems achievement. Notice how we update $counter
-# (even though the appropriate variable is already given to use in
-# ($globalData) so that the achievement progress bar works correctly.
-
-# Update counter from globalData
-$counter = $globalData->{'challengerCounter'};
-
-if ($counter >= $maxCounter) {
- return 1
-} else {
- return 0;
-}
-
-# Variable Descriptions:
-# - $problem : the problem data (changes tao this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/chipping_away.at b/courses.dist/modelCourse/templates/achievements/chipping_away.at
deleted file mode 100644
index 00d96e700..000000000
--- a/courses.dist/modelCourse/templates/achievements/chipping_away.at
+++ /dev/null
@@ -1,80 +0,0 @@
-#This checks to see if the student has worked on the set in
-# greater than 48 hours from time to first input to time to last answer.
-
-# If the set id doest equal the id of the last set then set
-# *this* set as the last set, and set the start time
-
-if ($problem->set_id ne $localData->{last_set}) {
- $localData->{last_set} = $problem->set_id;
- $localData->{start_time} = time();
- return 0;
-}
-
-# of we spent more than 48 hours then done!
-if ((time() - $localData->{start_time}) > 172800) {
- return 1;
-} else {
- return 0;
-}
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/complete_100_problems.at b/courses.dist/modelCourse/templates/achievements/complete_100_problems.at
deleted file mode 100644
index 199491ef1..000000000
--- a/courses.dist/modelCourse/templates/achievements/complete_100_problems.at
+++ /dev/null
@@ -1,74 +0,0 @@
-# This is a "solved n problems achievement. Notice how we update $counter
-# (even though the appropriate variable is already given to use in
-# ($globalData) so that the achievement progress bar works correctly.
-
-# Update counter from globalData
-$counter = $globalData->{'completeProblems'};
-
-if ($counter >= $maxCounter) {
- return 1
-} else {
- return 0;
-}
-
-# Variable Descriptions:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/complete_10_problems.at b/courses.dist/modelCourse/templates/achievements/complete_10_problems.at
deleted file mode 100644
index 199491ef1..000000000
--- a/courses.dist/modelCourse/templates/achievements/complete_10_problems.at
+++ /dev/null
@@ -1,74 +0,0 @@
-# This is a "solved n problems achievement. Notice how we update $counter
-# (even though the appropriate variable is already given to use in
-# ($globalData) so that the achievement progress bar works correctly.
-
-# Update counter from globalData
-$counter = $globalData->{'completeProblems'};
-
-if ($counter >= $maxCounter) {
- return 1
-} else {
- return 0;
-}
-
-# Variable Descriptions:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/complete_150_problems.at b/courses.dist/modelCourse/templates/achievements/complete_150_problems.at
deleted file mode 100644
index 199491ef1..000000000
--- a/courses.dist/modelCourse/templates/achievements/complete_150_problems.at
+++ /dev/null
@@ -1,74 +0,0 @@
-# This is a "solved n problems achievement. Notice how we update $counter
-# (even though the appropriate variable is already given to use in
-# ($globalData) so that the achievement progress bar works correctly.
-
-# Update counter from globalData
-$counter = $globalData->{'completeProblems'};
-
-if ($counter >= $maxCounter) {
- return 1
-} else {
- return 0;
-}
-
-# Variable Descriptions:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/complete_25_problems.at b/courses.dist/modelCourse/templates/achievements/complete_25_problems.at
deleted file mode 100644
index 199491ef1..000000000
--- a/courses.dist/modelCourse/templates/achievements/complete_25_problems.at
+++ /dev/null
@@ -1,74 +0,0 @@
-# This is a "solved n problems achievement. Notice how we update $counter
-# (even though the appropriate variable is already given to use in
-# ($globalData) so that the achievement progress bar works correctly.
-
-# Update counter from globalData
-$counter = $globalData->{'completeProblems'};
-
-if ($counter >= $maxCounter) {
- return 1
-} else {
- return 0;
-}
-
-# Variable Descriptions:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/complete_50_problems.at b/courses.dist/modelCourse/templates/achievements/complete_50_problems.at
deleted file mode 100644
index 199491ef1..000000000
--- a/courses.dist/modelCourse/templates/achievements/complete_50_problems.at
+++ /dev/null
@@ -1,74 +0,0 @@
-# This is a "solved n problems achievement. Notice how we update $counter
-# (even though the appropriate variable is already given to use in
-# ($globalData) so that the achievement progress bar works correctly.
-
-# Update counter from globalData
-$counter = $globalData->{'completeProblems'};
-
-if ($counter >= $maxCounter) {
- return 1
-} else {
- return 0;
-}
-
-# Variable Descriptions:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/complete_all_sets.at b/courses.dist/modelCourse/templates/achievements/complete_all_sets.at
deleted file mode 100644
index c5d58175a..000000000
--- a/courses.dist/modelCourse/templates/achievements/complete_all_sets.at
+++ /dev/null
@@ -1,74 +0,0 @@
-# This is a "solved n problems achievement. Notice how we update $counter
-# (even though the appropriate variable is already given to use in
-# ($globalData) so that the achievement progress bar works correctly.
-
-# Update counter from globalData
-$counter = $globalData->{'completeSets'};
-
-if ($counter >= $maxCounter) {
- return 1
-} else {
- return 0;
-}
-
-# Variable Descriptions:
-# - $problem : the problem data (changes tao this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/complete_five_sets.at b/courses.dist/modelCourse/templates/achievements/complete_five_sets.at
deleted file mode 100644
index f21335dee..000000000
--- a/courses.dist/modelCourse/templates/achievements/complete_five_sets.at
+++ /dev/null
@@ -1,74 +0,0 @@
-# This is a "solved n sets" achievement. Notice how we update $counter
-# (even though the appropriate variable is already given to use in
-# ($globalData) so that the achievement progress bar works correctly.
-
-# Update counter from globalData
-$counter = $globalData->{'completeSets'};
-
-if ($counter >= $maxCounter) {
- return 1
-} else {
- return 0;
-}
-
-# Variable Descriptions:
-# - $problem : the problem data (changes tao this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/complete_one_problem.at b/courses.dist/modelCourse/templates/achievements/complete_one_problem.at
deleted file mode 100644
index cf1008b35..000000000
--- a/courses.dist/modelCourse/templates/achievements/complete_one_problem.at
+++ /dev/null
@@ -1,72 +0,0 @@
-# This is a "solved n problems achievement. Normally we would have to deal
-# with the counter variable, but since n = 1 we dont have to
-
-# Achievement earned if they did the problem correctly
-if ($problem->status == 1) {
- return 1
-} else {
- return 0;
-}
-
-# Variable Descriptions:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->completeSets : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->complete Problems : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/complete_one_set.at b/courses.dist/modelCourse/templates/achievements/complete_one_set.at
deleted file mode 100644
index 9b8cc84d4..000000000
--- a/courses.dist/modelCourse/templates/achievements/complete_one_set.at
+++ /dev/null
@@ -1,70 +0,0 @@
-# This is a "solved n sets" achievement. However, since n=1 we just check to
-# see if the student has solved a set
-
-if ($globalData->{'completeSets'} >= 1) {
- return 1
-} else {
- return 0;
-}
-
-# Variable Descriptions:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/complete_ten_sets.at b/courses.dist/modelCourse/templates/achievements/complete_ten_sets.at
deleted file mode 100644
index c5d58175a..000000000
--- a/courses.dist/modelCourse/templates/achievements/complete_ten_sets.at
+++ /dev/null
@@ -1,74 +0,0 @@
-# This is a "solved n problems achievement. Notice how we update $counter
-# (even though the appropriate variable is already given to use in
-# ($globalData) so that the achievement progress bar works correctly.
-
-# Update counter from globalData
-$counter = $globalData->{'completeSets'};
-
-if ($counter >= $maxCounter) {
- return 1
-} else {
- return 0;
-}
-
-# Variable Descriptions:
-# - $problem : the problem data (changes tao this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/complete_thirty_sets.at b/courses.dist/modelCourse/templates/achievements/complete_thirty_sets.at
deleted file mode 100644
index c5d58175a..000000000
--- a/courses.dist/modelCourse/templates/achievements/complete_thirty_sets.at
+++ /dev/null
@@ -1,74 +0,0 @@
-# This is a "solved n problems achievement. Notice how we update $counter
-# (even though the appropriate variable is already given to use in
-# ($globalData) so that the achievement progress bar works correctly.
-
-# Update counter from globalData
-$counter = $globalData->{'completeSets'};
-
-if ($counter >= $maxCounter) {
- return 1
-} else {
- return 0;
-}
-
-# Variable Descriptions:
-# - $problem : the problem data (changes tao this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/complete_twenty_sets.at b/courses.dist/modelCourse/templates/achievements/complete_twenty_sets.at
deleted file mode 100644
index c5d58175a..000000000
--- a/courses.dist/modelCourse/templates/achievements/complete_twenty_sets.at
+++ /dev/null
@@ -1,74 +0,0 @@
-# This is a "solved n problems achievement. Notice how we update $counter
-# (even though the appropriate variable is already given to use in
-# ($globalData) so that the achievement progress bar works correctly.
-
-# Update counter from globalData
-$counter = $globalData->{'completeSets'};
-
-if ($counter >= $maxCounter) {
- return 1
-} else {
- return 0;
-}
-
-# Variable Descriptions:
-# - $problem : the problem data (changes tao this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/crack_o_dawn.at b/courses.dist/modelCourse/templates/achievements/crack_o_dawn.at
deleted file mode 100644
index 94e2d3322..000000000
--- a/courses.dist/modelCourse/templates/achievements/crack_o_dawn.at
+++ /dev/null
@@ -1,79 +0,0 @@
-# checks to see if a studen finished a set between 5AM and 7AM
- my @timeData = localtime(time);
-
- if ($timeData[2] < 5 || $timeData[2] > 6) {
- return 0;
- }
-
- #if it is check to see if we have finished the set
-
- foreach my $problemRecord (@setProblems) {
- if ($problemRecord->status != 1) {
- return 0;
- }
- }
-
- return 1;
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/curvy_geometry.at b/courses.dist/modelCourse/templates/achievements/curvy_geometry.at
deleted file mode 100644
index e637e74ca..000000000
--- a/courses.dist/modelCourse/templates/achievements/curvy_geometry.at
+++ /dev/null
@@ -1,84 +0,0 @@
-#This problem checks to see if a particular problem from a list of valid
-# sets and problems has been solved. (You would edit this file to say which
-# sets and problems count.)
-
-#constants
-my %validproblems = (
- 'SetNameHere' => { #now you show which problems are valid like:
- '2' => 1,
- '1' => 1, }, #and put more sets here
- );
-
-#check and see if this problem was solved
-if ($validproblems{$problem->set_id} &&
- $validproblems{$problem->set_id}{$problem->problem_id} &&
- $problem->status == 1 &&
- $problem->num_correct == 1) {
- return 1;
- }
-
- return 0;
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/default_achievements.axp b/courses.dist/modelCourse/templates/achievements/default_achievements.axp
deleted file mode 100644
index af4b4c3da..000000000
--- a/courses.dist/modelCourse/templates/achievements/default_achievements.axp
+++ /dev/null
@@ -1,62 +0,0 @@
-01_night_owl, Night Owl, secret, Finish a homework set between 12PM and 2AM., 10, , night_owl.at, night_owl.png,
-02_crack_o_dawn, Crack O' Dawn, secret, Finish a homework set between 5AM and 7AM., 10, , crack_o_dawn.at, crack_o_dawn.png,
-03_on_the_hour, Watching the Clock, secret, Finish a problem at the top of the hour., 10, , on_the_hour.at, on_the_hour.png,
-04_last_minute, Last Minute Math, secret, Complete a homework within 30 minutes of the due date., 10, , last_minute.at, last_minute.png,
-05_still_not_right, Its Still Not Right, secret, Input the exact same (incorrect) answer 10 times in a row., 5, , still_not_right.at, still_not_right.png,
-06_persistance, Persistence is not Futile, secret, Solve a problem after 20 incorrect submissions., 10, , persistance.at, persistance.png,
-07_super_persistance, Green Never Looked So Good, secret, Solve a problem after 100 incorrect submissions., 10, , super_persistance.at, super_persistance.png,
-08_super_speed_math, Careful Planning and Quick Fingers, secret, Spend less than 10 minutes entering answers to a homework set., 20, , super_speed_math.at, super_speed_math.png,
-09_hows_your_finger, Hows Your Finger?, secret, Have more than 250 submissions on a homework problem. , 10, , hows_your_finger.at, hows_your_finger.png,
-01_one_click, One Click Is All I Need, 01_one_timer, Earn 100% on a problem in one attempt., 10, , one_click.at, one_click.png,
-02_on_one_hand, On One Hand, 01_one_timer, Finish a homework set with less than 5 incorrect submissions., 10, , on_one_hand.at, on_one_hand.png,
-03_seeing_green, Seeing Green, 01_one_timer, Finish a homework set with no incorrect submissions., 20, , seeing_green.at, seeing_green.png,
-04_early_bird, The Early Bird, 01_one_timer, Finish a homework set within 24 hours of it opening., 10, , early_bird.at, early_bird.png,
-05_really_early_bird, The Really Early Bird, 01_one_timer, Finish a homework set within 2 hours of it opening., 20, , really_early_bird.at, really_early_bird.png,
-06_back_for_more, Back For More, 01_one_timer, Retry a problem after a 8 hour break., 10, , back_for_more.at, back_for_more.png,
-07_chipping_away, Just Keep Chipping Away, 01_one_timer, Work on a single homework set over the course of 48 hours., 10, , chipping_away.at, chipping_away.png,
-08_speed_mather, Go Speed Math-er, 01_one_timer, Spend less than 1 hour working on a homework set., 10, , speed_mather.at, speed_mather.png,
-09_three_in_a_row, Three in a Row, 01_one_timer, Complete 3 problems in a row with no incorrect answers., 10, 3, three_in_a_row.at, one_click.png,
-10_on_fire, Your on Fire!, 01_one_timer, Complete 10 problems in a row with no incorrect answers., 20, 10, on_fire.at, on_fire.png,
-01_reaching_a_limit, Reaching a Limit, 02_content, Solve 10 basic limit problems., 10, 10, reaching_a_limit.at, reaching_a_limit.png,
-02_by_definition, By Definition, 02_content, Evaluate a derivative using the limit definition., 10, , by_definition.at, by_definition.png,
-03_derivative_master, Derivative Master, 02_content, Solve 30 basic derivatives., 20, 30, derivative_master.at, derivative_master.png,
-04_optimizer_prime, Optimizer Prime, 02_content, Solve a particularly hard optimization problem., 10, , optimizer_prime.at, optimizer_prime.png,
-05_its_all_relative, Its All Relative, 02_content, Solve a particularly hard related rates problem., 10, , its_all_relative.at, its_all_relative.png,
-06_pattern_recognition, Pattern Recognition, 02_content, Find the nth derivative of a function., 10, , pattern_recognition.at, pattern_recognition.png,
-07_the_lhopital, Take me to the L'Hopital, 02_content, Use L'Hopital's Rule to evaluate a limit., 10, , the_lhopital.at, the_lhopital.png,
-08_the_fundamentals, Covering the Fundamentals, 02_content, Use the Fundamental Theorem of Calculus., 10, , the_fundamentals.at, the_fundamentals.png,
-09_curvy_geometry, Curvy Geometry, 02_content, Find the area between two curves., 10, , curvy_geometry.at, curvy_geometry.png,
-10_doing_it_backwards, Doing It Backwards, 02_content, Solve 5 u-substitution problems., 10, 5, doing_it_backwards.at, doing_it_backwards.png,
-01_complete_one_set, One Set Wonder, 03_complete_sets, Get 100% on one homework set., 10, , complete_one_set.at, complete_one_set.png,
-02_complete_five_sets, High Five, 03_complete_sets, Get 100% on five homework sets., 10, 5, complete_five_sets.at, complete_five_sets.png,
-03_complete_ten_sets, One For Each Finger, 03_complete_sets, Get 100% on ten homework sets., 10, 10, complete_ten_sets.at, complete_ten_sets.png,
-04_complete_twenty_sets, Mathbox Twenty, 03_complete_sets, Get 100% on twenty homework sets., 20, 20, complete_twenty_sets.at, complete_twenty_sets.png,
-05_complete_thirty_sets, The Long Road, 03_complete_sets, Get 100% on thirty homework sets., 20, 30, complete_thirty_sets.at, complete_thirty_sets.png,
-06_complete_all_sets, Perfection, 03_complete_sets, Get 100% on all homework sets., 30, 35, complete_all_sets.at, complete_all_sets.png,
-01_challenge_one, Challenge One Complete, 04_challenge, Finish the first challenge problem., 10, , challenge_one.at, challenge_one.png,
-02_challenge_two, Challenge Two Complete, 04_challenge, Finish the second challenge problem., 10, , challenge_two.at, challenge_two.png,
-03_challenge_three, Challenge Three Complete, 04_challenge, Finish the third challenge problem., 10, , challenge_three.at, challenge_three.png,
-04_challenge_four, Challenge Four Complete, 04_challenge, Finish the fourth challenge problem., 10, , challenge_four.at, challenge_four.png,
-05_challenge_five, Challenge Five Complete, 04_challenge, Finish the fifth challenge problem., 10, , challenge_five.at, challenge_five.png,
-06_challenge_six, Challenge Six Complete, 04_challenge, Finish the sixth challenge problem., 10, , challenge_six.at, challenge_six.png,
-07_challenge_seven, Challenge Seven Complete, 04_challenge, Finish the seventh challenge problem., 10, , challenge_seven.at, challenge_seven.png,
-08_challenge_eight, Challenge Eight Complete, 04_challenge, Finish the eighth challenge problem., 10, , challenge_eight.at, challenge_eight.png,
-09_challenge_nine, Challenge Nine Complete, 04_challenge, Finish the ninth challenge problem., 10, , challenge_nine.at, challenge_nine.png,
-10_challenge_ten, Challenge Ten Complete, 04_challenge, Finish the tenth challenge problem., 10, , challenge_ten.at, challenge_ten.png,
-11_challenger, Challenger, 04_challenge, Finish all of the challenge problems., 10, 20, challenger.at, challenger.png,
-01_complete_one_problem, The First Step, 05_complete_problems, Earn 100% on a homework problem., 10, , complete_one_problem.at, complete_one_problem.png,
-02_complete_10_problems, Perfect 10, 05_complete_problems, Earn 100% on 10 homework problems., 10, 10, complete_10_problems.at, complete_10_problems.png,
-03_complete_25_problems, Twenty-Five Questions, 05_complete_problems, Earn 100% on 25 homework problems., 10, 25, complete_25_problems.at, complete_25_problems.png,
-04_complete_50_problems, 50 Ways to Solve a Math Problem, 05_complete_problems, Earn 100% on 50 homework problems., 10, 50, complete_50_problems.at, complete_50_problems.png,
-05_complete_100_problems, Seeing Benjamins, 05_complete_problems, Earn 100% on 100 homework problems., 20, 100, complete_100_problems.at, complete_100_problems.png,
-06_complete_150_problems, Sesqui-Centeni-Problems, 05_complete_problems, Earn 100% on 150 homework problems., 20, 150, complete_150_problems.at, complete_150_problems.png,
-01_level_one, Level 1 Calculus Initiate, level, , , , level_one.at, level_one.png,
-02_level_two, Level 2 Calculus Novice, level, , , , level_two.at, level_two.png,
-03_level_three, Level 3 Calculus Apprentice, level, , , , level_three.at, level_three.png,
-04_level_four, Level 4 Calculus Journeyman, level, , , , level_four.at, level_four.png,
-05_level_five, Level 5 Calculus Fellowcraft, level, , , , level_five.at, level_five.png,
-06_level_six, Level 6 Calculus Adept, level, , , , level_six.at, level_six.png,
-07_level_seven, Level 7 Calculus Craftsman, level, , , , level_seven.at, level_seven.png,
-08_level_eight, Level 8 Calculus Artesian, level, , , , level_eight.at, level_eight.png,
-09_level_nine, Level 9 Calculus Specialist, level, , , , level_nine.at, level_nine.png,
-10_level_ten, Level 10 Calculus Professor, level, , , , level_ten.at, level_ten.png,
diff --git a/courses.dist/modelCourse/templates/achievements/derivative_master.at b/courses.dist/modelCourse/templates/achievements/derivative_master.at
deleted file mode 100644
index e1b17b06b..000000000
--- a/courses.dist/modelCourse/templates/achievements/derivative_master.at
+++ /dev/null
@@ -1,88 +0,0 @@
-#This problem checks to see if a particular problem from a list of valid
-# sets and problems has been solved. If it has then it updates the counter
-#(You would edit this file to say which sets and problems count.)
-
-#constants
-my %validproblems = (
- 'SetNameHere' => { #now you show which problems are valid like:
- '2' => 1,
- '1' => 1, }, #and put more sets here
- );
-
-#check and see if this problem was solved
-if ($validproblems{$problem->set_id} &&
- $validproblems{$problem->set_id}{$problem->problem_id} &&
- $problem->status == 1 &&
- $problem->num_correct == 1) {
- #update counter;
- $counter++;
- }
-
-if ($counter >= $maxCounter) {
- return 1;
-} else {
- return 0;
-}
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/doing_it_backwards.at b/courses.dist/modelCourse/templates/achievements/doing_it_backwards.at
deleted file mode 100644
index 716da57d7..000000000
--- a/courses.dist/modelCourse/templates/achievements/doing_it_backwards.at
+++ /dev/null
@@ -1,89 +0,0 @@
-#This problem checks to see if a particular problem from a list of valid
-# sets and problems has been solved. If it has then it updates the counter
-#(You would edit this file to say which sets and problems count.)
-
-#constants
-my %validproblems = (
- 'SetNameHere' => { #now you show which problems are valid like:
- '2' => 1,
- '1' => 1, }, #and put more sets here
- );
-
-#check and see if this problem was solved
-if ($validproblems{$problem->set_id} &&
- $validproblems{$problem->set_id}{$problem->problem_id} &&
- $problem->status == 1 &&
- $problem->num_correct == 1) {
- #update counter;
- $counter++;
- }
-
-if ($counter >= $maxCounter) {
- return 1;
-} else {
- return 0;
-}
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/early_bird.at b/courses.dist/modelCourse/templates/achievements/early_bird.at
deleted file mode 100644
index 649890e43..000000000
--- a/courses.dist/modelCourse/templates/achievements/early_bird.at
+++ /dev/null
@@ -1,78 +0,0 @@
-#This checks to see if the student has finished the set within a certain time
-
- #test to see if it is before 1 day after the open date
- if ((time()-$set->open_date) > 86400) {
- return 0;
- }
-
- #if it is check to see if we have finished the set
- foreach my $problemRecord (@setProblems) {
- if ($problemRecord->status != 1) {
- return 0;
- }
- }
-
- return 1;
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/heart_area.at b/courses.dist/modelCourse/templates/achievements/heart_area.at
deleted file mode 100644
index e637e74ca..000000000
--- a/courses.dist/modelCourse/templates/achievements/heart_area.at
+++ /dev/null
@@ -1,84 +0,0 @@
-#This problem checks to see if a particular problem from a list of valid
-# sets and problems has been solved. (You would edit this file to say which
-# sets and problems count.)
-
-#constants
-my %validproblems = (
- 'SetNameHere' => { #now you show which problems are valid like:
- '2' => 1,
- '1' => 1, }, #and put more sets here
- );
-
-#check and see if this problem was solved
-if ($validproblems{$problem->set_id} &&
- $validproblems{$problem->set_id}{$problem->problem_id} &&
- $problem->status == 1 &&
- $problem->num_correct == 1) {
- return 1;
- }
-
- return 0;
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/hows_your_finger.at b/courses.dist/modelCourse/templates/achievements/hows_your_finger.at
deleted file mode 100644
index 7ef8eb8c8..000000000
--- a/courses.dist/modelCourse/templates/achievements/hows_your_finger.at
+++ /dev/null
@@ -1,71 +0,0 @@
-#This checks to see if the student has above a certain number of attempts
-
- if ($problem->num_correct + $problem->num_incorrect >= 250) {
- return 1;
- } else {
- return 0;
- }
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/integral_master.at b/courses.dist/modelCourse/templates/achievements/integral_master.at
deleted file mode 100644
index e637e74ca..000000000
--- a/courses.dist/modelCourse/templates/achievements/integral_master.at
+++ /dev/null
@@ -1,84 +0,0 @@
-#This problem checks to see if a particular problem from a list of valid
-# sets and problems has been solved. (You would edit this file to say which
-# sets and problems count.)
-
-#constants
-my %validproblems = (
- 'SetNameHere' => { #now you show which problems are valid like:
- '2' => 1,
- '1' => 1, }, #and put more sets here
- );
-
-#check and see if this problem was solved
-if ($validproblems{$problem->set_id} &&
- $validproblems{$problem->set_id}{$problem->problem_id} &&
- $problem->status == 1 &&
- $problem->num_correct == 1) {
- return 1;
- }
-
- return 0;
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/its_all_relative.at b/courses.dist/modelCourse/templates/achievements/its_all_relative.at
deleted file mode 100644
index ca38f8801..000000000
--- a/courses.dist/modelCourse/templates/achievements/its_all_relative.at
+++ /dev/null
@@ -1,84 +0,0 @@
-#This problem checks to see if a particular problem from a list of valid
-# sets and problems has been solved. (You would edit this file to say which
-# sets and problems count.)
-
-#constants
-my %validproblems = (
- 'TestSet' => { #now you show which problems are valid like:
- '1' => 1,
- '2' => 1, }, #and put more sets here
- );
-
-#check and see if this problem was solved
-if ($validproblems{$problem->set_id} &&
- $validproblems{$problem->set_id}{$problem->problem_id} &&
- $problem->status == 1 &&
- $problem->num_correct == 1) {
- return 1;
- }
-
- return 0;
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/la_revolucion.at b/courses.dist/modelCourse/templates/achievements/la_revolucion.at
deleted file mode 100644
index e637e74ca..000000000
--- a/courses.dist/modelCourse/templates/achievements/la_revolucion.at
+++ /dev/null
@@ -1,84 +0,0 @@
-#This problem checks to see if a particular problem from a list of valid
-# sets and problems has been solved. (You would edit this file to say which
-# sets and problems count.)
-
-#constants
-my %validproblems = (
- 'SetNameHere' => { #now you show which problems are valid like:
- '2' => 1,
- '1' => 1, }, #and put more sets here
- );
-
-#check and see if this problem was solved
-if ($validproblems{$problem->set_id} &&
- $validproblems{$problem->set_id}{$problem->problem_id} &&
- $problem->status == 1 &&
- $problem->num_correct == 1) {
- return 1;
- }
-
- return 0;
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/last_minute.at b/courses.dist/modelCourse/templates/achievements/last_minute.at
deleted file mode 100644
index e15f79783..000000000
--- a/courses.dist/modelCourse/templates/achievements/last_minute.at
+++ /dev/null
@@ -1,77 +0,0 @@
-# checks to see if a studen finished a set close to the due date
-
- #test to see if it is within 30 min of the due date
- if (($set->due_date - time()) > 1800) {
- return 0;
- }
-
- foreach my $problemRecord (@setProblems) {
- if ($problemRecord->status != 1) {
- return 0;
- }
- }
-
- return 1;
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/level_eight.at b/courses.dist/modelCourse/templates/achievements/level_eight.at
deleted file mode 100644
index f005f9a94..000000000
--- a/courses.dist/modelCourse/templates/achievements/level_eight.at
+++ /dev/null
@@ -1,86 +0,0 @@
-# This is a "level" achievement and they behave slightly differently. When
-# a level achievement is earned the system uses the icon and title of the
-# level achievement as the icon and title of that students level. There
-# are two additional variables available to level achievements
-# - $achievementPoints : the number of achievement points the current
-# user has. (Changes to this variable will *not* be saved.)
-# - $nextLevelPoints : the number of points needed to earn a level.
-# (Changes to this variable will be saved if a new level is earned.)
-# These variables are used to construct the users level progress bar
-
-#Constants:
-#Threshold for level 9
-my $newLevelThreshold = 1200;
-
-#Code
-
-if ($achievementPoints >= $nextLevelPoints) {
- #set new threshold and return 1
- $nextLevelPoints = $newLevelThreshold;
- return 1;
-} else {
- return 0;
-}
-
-# Variable Descriptions:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->completeSets : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->complete Problems : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/level_five.at b/courses.dist/modelCourse/templates/achievements/level_five.at
deleted file mode 100644
index 79dfd3909..000000000
--- a/courses.dist/modelCourse/templates/achievements/level_five.at
+++ /dev/null
@@ -1,86 +0,0 @@
-# This is a "level" achievement and they behave slightly differently. When
-# a level achievement is earned the system uses the icon and title of the
-# level achievement as the icon and title of that students level. There
-# are two additional variables available to level achievements
-# - $achievementPoints : the number of achievement points the current
-# user has. (Changes to this variable will *not* be saved.)
-# - $nextLevelPoints : the number of points needed to earn a level.
-# (Changes to this variable will be saved if a new level is earned.)
-# These variables are used to construct the users level progress bar
-
-#Constants:
-#Threshold for level 6
-my $newLevelThreshold = 750;
-
-#Code
-
-if ($achievementPoints >= $nextLevelPoints) {
- #set new threshold and return 1
- $nextLevelPoints = $newLevelThreshold;
- return 1;
-} else {
- return 0;
-}
-
-# Variable Descriptions:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->completeSets : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->complete Problems : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/level_four.at b/courses.dist/modelCourse/templates/achievements/level_four.at
deleted file mode 100644
index d7187aaac..000000000
--- a/courses.dist/modelCourse/templates/achievements/level_four.at
+++ /dev/null
@@ -1,86 +0,0 @@
-# This is a "level" achievement and they behave slightly differently. When
-# a level achievement is earned the system uses the icon and title of the
-# level achievement as the icon and title of that students level. There
-# are two additional variables available to level achievements
-# - $achievementPoints : the number of achievement points the current
-# user has. (Changes to this variable will *not* be saved.)
-# - $nextLevelPoints : the number of points needed to earn a level.
-# (Changes to this variable will be saved if a new level is earned.)
-# These variables are used to construct the users level progress bar
-
-#Constants:
-#Threshold for level 5
-my $newLevelThreshold = 600;
-
-#Code
-
-if ($achievementPoints >= $nextLevelPoints) {
- #set new threshold and return 1
- $nextLevelPoints = $newLevelThreshold;
- return 1;
-} else {
- return 0;
-}
-
-# Variable Descriptions:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->completeSets : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->complete Problems : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/level_nine.at b/courses.dist/modelCourse/templates/achievements/level_nine.at
deleted file mode 100644
index 810989e66..000000000
--- a/courses.dist/modelCourse/templates/achievements/level_nine.at
+++ /dev/null
@@ -1,86 +0,0 @@
-# This is a "level" achievement and they behave slightly differently. When
-# a level achievement is earned the system uses the icon and title of the
-# level achievement as the icon and title of that students level. There
-# are two additional variables available to level achievements
-# - $achievementPoints : the number of achievement points the current
-# user has. (Changes to this variable will *not* be saved.)
-# - $nextLevelPoints : the number of points needed to earn a level.
-# (Changes to this variable will be saved if a new level is earned.)
-# These variables are used to construct the users level progress bar
-
-#Constants:
-#Level 10 threshold
-my $newLevelThreshold = 1350;
-
-#Code
-
-if ($achievementPoints >= $nextLevelPoints) {
- #set new threshold and return 1
- $nextLevelPoints = $newLevelThreshold;
- return 1;
-} else {
- return 0;
-}
-
-# Variable Descriptions:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->completeSets : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->complete Problems : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/level_one.at b/courses.dist/modelCourse/templates/achievements/level_one.at
deleted file mode 100644
index 78d684638..000000000
--- a/courses.dist/modelCourse/templates/achievements/level_one.at
+++ /dev/null
@@ -1,83 +0,0 @@
-# This is a "level" achievement and they behave slightly differently. When
-# a level achievement is earned the system uses the icon and title of the
-# level achievement as the icon and title of that students level. There
-# are two additional variables available to level achievements
-# - $achievementPoints : the number of achievement points the current
-# user has. (Changes to this variable will *not* be saved.)
-# - $nextLevelPoints : the number of points needed to earn a level.
-# (Changes to this variable will be saved if a new level is earned.)
-# These variables are used to construct the users level progress bar
-
-#Constants:
-#Threshold for level 2
-my $newLevelThreshold = 150;
-
-#Code
-
-#level 1 is earned immediately
-$nextLevelPoints = $newLevelThreshold;
-return 1;
-
-
-# Variable Descriptions:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->completeSets : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->complete Problems : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/level_seven.at b/courses.dist/modelCourse/templates/achievements/level_seven.at
deleted file mode 100644
index ce250d0bb..000000000
--- a/courses.dist/modelCourse/templates/achievements/level_seven.at
+++ /dev/null
@@ -1,86 +0,0 @@
-# This is a "level" achievement and they behave slightly differently. When
-# a level achievement is earned the system uses the icon and title of the
-# level achievement as the icon and title of that students level. There
-# are two additional variables available to level achievements
-# - $achievementPoints : the number of achievement points the current
-# user has. (Changes to this variable will *not* be saved.)
-# - $nextLevelPoints : the number of points needed to earn a level.
-# (Changes to this variable will be saved if a new level is earned.)
-# These variables are used to construct the users level progress bar
-
-#Constants:
-#Threshold for level 8
-my $newLevelThreshold = 1050;
-
-#Code
-
-if ($achievementPoints >= $nextLevelPoints) {
- #set new threshold and return 1
- $nextLevelPoints = $newLevelThreshold;
- return 1;
-} else {
- return 0;
-}
-
-# Variable Descriptions:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->completeSets : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->complete Problems : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/level_six.at b/courses.dist/modelCourse/templates/achievements/level_six.at
deleted file mode 100644
index d76f6c735..000000000
--- a/courses.dist/modelCourse/templates/achievements/level_six.at
+++ /dev/null
@@ -1,86 +0,0 @@
-# This is a "level" achievement and they behave slightly differently. When
-# a level achievement is earned the system uses the icon and title of the
-# level achievement as the icon and title of that students level. There
-# are two additional variables available to level achievements
-# - $achievementPoints : the number of achievement points the current
-# user has. (Changes to this variable will *not* be saved.)
-# - $nextLevelPoints : the number of points needed to earn a level.
-# (Changes to this variable will be saved if a new level is earned.)
-# These variables are used to construct the users level progress bar
-
-#Constants:
-#Threshold for level 7
-my $newLevelThreshold = 900;
-
-#Code
-
-if ($achievementPoints >= $nextLevelPoints) {
- #set new threshold and return 1
- $nextLevelPoints = $newLevelThreshold;
- return 1;
-} else {
- return 0;
-}
-
-# Variable Descriptions:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->completeSets : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->complete Problems : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/level_ten.at b/courses.dist/modelCourse/templates/achievements/level_ten.at
deleted file mode 100644
index 4212d7ff2..000000000
--- a/courses.dist/modelCourse/templates/achievements/level_ten.at
+++ /dev/null
@@ -1,86 +0,0 @@
-# This is a "level" achievement and they behave slightly differently. When
-# a level achievement is earned the system uses the icon and title of the
-# level achievement as the icon and title of that students level. There
-# are two additional variables available to level achievements
-# - $achievementPoints : the number of achievement points the current
-# user has. (Changes to this variable will *not* be saved.)
-# - $nextLevelPoints : the number of points needed to earn a level.
-# (Changes to this variable will be saved if a new level is earned.)
-# These variables are used to construct the users level progress bar
-
-#Constants:
-#Level 10 is the last level so dont set a threshhold to remove the progress bar
-my $newLevelThreshold = '';
-
-#Code
-
-if ($achievementPoints >= $nextLevelPoints) {
- #set new threshold and return 1
- $nextLevelPoints = $newLevelThreshold;
- return 1;
-} else {
- return 0;
-}
-
-# Variable Descriptions:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->completeSets : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->complete Problems : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/level_three.at b/courses.dist/modelCourse/templates/achievements/level_three.at
deleted file mode 100644
index ec34e20aa..000000000
--- a/courses.dist/modelCourse/templates/achievements/level_three.at
+++ /dev/null
@@ -1,86 +0,0 @@
-# This is a "level" achievement and they behave slightly differently. When
-# a level achievement is earned the system uses the icon and title of the
-# level achievement as the icon and title of that students level. There
-# are two additional variables available to level achievements
-# - $achievementPoints : the number of achievement points the current
-# user has. (Changes to this variable will *not* be saved.)
-# - $nextLevelPoints : the number of points needed to earn a level.
-# (Changes to this variable will be saved if a new level is earned.)
-# These variables are used to construct the users level progress bar
-
-#Constants:
-#Threshold for level 4
-my $newLevelThreshold = 450;
-
-#Code
-
-if ($achievementPoints >= $nextLevelPoints) {
- #set new threshold and return 1
- $nextLevelPoints = $newLevelThreshold;
- return 1;
-} else {
- return 0;
-}
-
-# Variable Descriptions:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->completeSets : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->complete Problems : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/level_two.at b/courses.dist/modelCourse/templates/achievements/level_two.at
deleted file mode 100644
index e6290d20c..000000000
--- a/courses.dist/modelCourse/templates/achievements/level_two.at
+++ /dev/null
@@ -1,86 +0,0 @@
-# This is a "level" achievement and they behave slightly differently. When
-# a level achievement is earned the system uses the icon and title of the
-# level achievement as the icon and title of that students level. There
-# are two additional variables available to level achievements
-# - $achievementPoints : the number of achievement points the current
-# user has. (Changes to this variable will *not* be saved.)
-# - $nextLevelPoints : the number of points needed to earn a level.
-# (Changes to this variable will be saved if a new level is earned.)
-# These variables are used to construct the users level progress bar
-
-#Constants:
-#Threshold for level 3
-my $newLevelThreshold = 300;
-
-#Code
-
-if ($achievementPoints >= $nextLevelPoints) {
- #set new threshold and return 1
- $nextLevelPoints = $newLevelThreshold;
- return 1;
-} else {
- return 0;
-}
-
-# Variable Descriptions:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->completeSets : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->complete Problems : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/many_fractions.at b/courses.dist/modelCourse/templates/achievements/many_fractions.at
deleted file mode 100644
index e637e74ca..000000000
--- a/courses.dist/modelCourse/templates/achievements/many_fractions.at
+++ /dev/null
@@ -1,84 +0,0 @@
-#This problem checks to see if a particular problem from a list of valid
-# sets and problems has been solved. (You would edit this file to say which
-# sets and problems count.)
-
-#constants
-my %validproblems = (
- 'SetNameHere' => { #now you show which problems are valid like:
- '2' => 1,
- '1' => 1, }, #and put more sets here
- );
-
-#check and see if this problem was solved
-if ($validproblems{$problem->set_id} &&
- $validproblems{$problem->set_id}{$problem->problem_id} &&
- $problem->status == 1 &&
- $problem->num_correct == 1) {
- return 1;
- }
-
- return 0;
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/night_owl.at b/courses.dist/modelCourse/templates/achievements/night_owl.at
deleted file mode 100644
index 09afe57e9..000000000
--- a/courses.dist/modelCourse/templates/achievements/night_owl.at
+++ /dev/null
@@ -1,80 +0,0 @@
-# checks to see if a studen finished a set between 12AM and 2AM
- my @timeData = localtime(time);
-
- #test to see if it is between midnight and 2am
- if ($timeData[2] > 1) {
- return 0;
- }
-
- #if it is check to see if we have finished the set
-
- foreach my $problemRecord (@setProblems) {
- if ($problemRecord->status != 1) {
- return 0;
- }
- }
-
- return 1;
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/on_fire.at b/courses.dist/modelCourse/templates/achievements/on_fire.at
deleted file mode 100644
index b97b53c83..000000000
--- a/courses.dist/modelCourse/templates/achievements/on_fire.at
+++ /dev/null
@@ -1,82 +0,0 @@
-#This checks to see if the student has solved 10 problems without having any
-# incorrect answers
-
-# reset counter if they got something wrong
-if ($problem->status < 1) {
- $counter = 0;
- return 0;
-# if they are right update the counter
-} elsif ($problem->status == 1 &&
- $problem->num_correct == 1 &&
- $problem->num_incorrect == 0 ) {
- $counter++;
-}
-
-if ($counter >= $maxCounter) {
- return 1;
-} else {
- return 0;
-}
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/on_one_hand.at b/courses.dist/modelCourse/templates/achievements/on_one_hand.at
deleted file mode 100644
index 0d9203d7e..000000000
--- a/courses.dist/modelCourse/templates/achievements/on_one_hand.at
+++ /dev/null
@@ -1,78 +0,0 @@
-#This checks to see if the student has finished the set
-# with fewer than a certain number of incorrect submissions
-
- my $numfails = 0;
-
- #cycle through and leave if we have too many incorrects or a wrong problem
- foreach my $problemRecord (@setProblems) {
- $numfails += $problemRecord->num_incorrect;
- if ($problemRecord->status != 1 || $numfails >5) {
- return 0;
- }
- }
-
- return 1;
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/on_the_hour.at b/courses.dist/modelCourse/templates/achievements/on_the_hour.at
deleted file mode 100644
index bc393439b..000000000
--- a/courses.dist/modelCourse/templates/achievements/on_the_hour.at
+++ /dev/null
@@ -1,77 +0,0 @@
-# checks to see if a studen finished a problem at the top of an hour
- my @timeData = localtime(time);
-
- #test to see if it is near the top of an hour
- if ($timeData[1] > 0) {
- return 0;
- }
-
- #test to see if the problem is correct and this is the first run
- if ($problem-> status != 1 || $problem->num_correct != 1) {
- return 0;
- }
-
- return 1;
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/one_click.at b/courses.dist/modelCourse/templates/achievements/one_click.at
deleted file mode 100644
index c83ad25ac..000000000
--- a/courses.dist/modelCourse/templates/achievements/one_click.at
+++ /dev/null
@@ -1,72 +0,0 @@
-#This checks to see if the student has finished the problem with no
-# incorrect submissions
-
- if ($problem->status == 1 && $problem->num_incorrect == 0) {
- return 1;
- } else {
- return 0;
- }
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/optimizer_prime.at b/courses.dist/modelCourse/templates/achievements/optimizer_prime.at
deleted file mode 100644
index e637e74ca..000000000
--- a/courses.dist/modelCourse/templates/achievements/optimizer_prime.at
+++ /dev/null
@@ -1,84 +0,0 @@
-#This problem checks to see if a particular problem from a list of valid
-# sets and problems has been solved. (You would edit this file to say which
-# sets and problems count.)
-
-#constants
-my %validproblems = (
- 'SetNameHere' => { #now you show which problems are valid like:
- '2' => 1,
- '1' => 1, }, #and put more sets here
- );
-
-#check and see if this problem was solved
-if ($validproblems{$problem->set_id} &&
- $validproblems{$problem->set_id}{$problem->problem_id} &&
- $problem->status == 1 &&
- $problem->num_correct == 1) {
- return 1;
- }
-
- return 0;
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/pattern_recognition.at b/courses.dist/modelCourse/templates/achievements/pattern_recognition.at
deleted file mode 100644
index e637e74ca..000000000
--- a/courses.dist/modelCourse/templates/achievements/pattern_recognition.at
+++ /dev/null
@@ -1,84 +0,0 @@
-#This problem checks to see if a particular problem from a list of valid
-# sets and problems has been solved. (You would edit this file to say which
-# sets and problems count.)
-
-#constants
-my %validproblems = (
- 'SetNameHere' => { #now you show which problems are valid like:
- '2' => 1,
- '1' => 1, }, #and put more sets here
- );
-
-#check and see if this problem was solved
-if ($validproblems{$problem->set_id} &&
- $validproblems{$problem->set_id}{$problem->problem_id} &&
- $problem->status == 1 &&
- $problem->num_correct == 1) {
- return 1;
- }
-
- return 0;
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/persistance.at b/courses.dist/modelCourse/templates/achievements/persistance.at
deleted file mode 100644
index 027894be0..000000000
--- a/courses.dist/modelCourse/templates/achievements/persistance.at
+++ /dev/null
@@ -1,72 +0,0 @@
-#This checks to see if the student has solved the problem after a certain
-# number of incorrect attempts
-
- if ($problem->status == 1 && $problem->num_incorrect >= 20) {
- return 1
- } else {
- return 0;
- }
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/put_me_in_coach.at b/courses.dist/modelCourse/templates/achievements/put_me_in_coach.at
deleted file mode 100644
index e637e74ca..000000000
--- a/courses.dist/modelCourse/templates/achievements/put_me_in_coach.at
+++ /dev/null
@@ -1,84 +0,0 @@
-#This problem checks to see if a particular problem from a list of valid
-# sets and problems has been solved. (You would edit this file to say which
-# sets and problems count.)
-
-#constants
-my %validproblems = (
- 'SetNameHere' => { #now you show which problems are valid like:
- '2' => 1,
- '1' => 1, }, #and put more sets here
- );
-
-#check and see if this problem was solved
-if ($validproblems{$problem->set_id} &&
- $validproblems{$problem->set_id}{$problem->problem_id} &&
- $problem->status == 1 &&
- $problem->num_correct == 1) {
- return 1;
- }
-
- return 0;
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/reaching_a_limit.at b/courses.dist/modelCourse/templates/achievements/reaching_a_limit.at
deleted file mode 100644
index 8c1c78fc8..000000000
--- a/courses.dist/modelCourse/templates/achievements/reaching_a_limit.at
+++ /dev/null
@@ -1,89 +0,0 @@
-#This problem checks to see if a particular problem from a list of valid
-# sets and problems has been solved. If it has then it updates the counter
-#(You would edit this file to say which sets and problems count.)
-
-#constants
-my %validproblems = (
- 'SetNameHere' => { #now you show which problems are valid like:
- '2' => 1,
- '1' => 1, }, #and put more sets here
- );
-
-#check and see if this problem was solved
-if ($validproblems{$problem->set_id} &&
- $validproblems{$problem->set_id}{$problem->problem_id} &&
- $problem->status == 1 &&
- $problem->num_correct == 1) {
- #update counter;
- $counter++;
- }
-
-if ($counter >= $maxCounter) {
- return 1;
-} else {
- return 0;
-}
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/really_early_bird.at b/courses.dist/modelCourse/templates/achievements/really_early_bird.at
deleted file mode 100644
index 7d5c62138..000000000
--- a/courses.dist/modelCourse/templates/achievements/really_early_bird.at
+++ /dev/null
@@ -1,78 +0,0 @@
-#This checks to see if the student has finished the set within a certain time
-
- #test to see if it is before 2 hours after the open date
- if ((time()-$set->open_date) > 7200) {
- return 0;
- }
-
- #if it is check to see if we have finished the set
- foreach my $problemRecord (@setProblems) {
- if ($problemRecord->status != 1) {
- return 0;
- }
- }
-
- return 1;
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/revolucion_redux.at b/courses.dist/modelCourse/templates/achievements/revolucion_redux.at
deleted file mode 100644
index e637e74ca..000000000
--- a/courses.dist/modelCourse/templates/achievements/revolucion_redux.at
+++ /dev/null
@@ -1,84 +0,0 @@
-#This problem checks to see if a particular problem from a list of valid
-# sets and problems has been solved. (You would edit this file to say which
-# sets and problems count.)
-
-#constants
-my %validproblems = (
- 'SetNameHere' => { #now you show which problems are valid like:
- '2' => 1,
- '1' => 1, }, #and put more sets here
- );
-
-#check and see if this problem was solved
-if ($validproblems{$problem->set_id} &&
- $validproblems{$problem->set_id}{$problem->problem_id} &&
- $problem->status == 1 &&
- $problem->num_correct == 1) {
- return 1;
- }
-
- return 0;
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/seeing_green.at b/courses.dist/modelCourse/templates/achievements/seeing_green.at
deleted file mode 100644
index 948a4eed4..000000000
--- a/courses.dist/modelCourse/templates/achievements/seeing_green.at
+++ /dev/null
@@ -1,80 +0,0 @@
-#This checks to see if the student has finished the set
-# with fewer than a certain number of incorrect submissions
-
- my $allcorrect = 1;
-
- foreach my $problemRecord (@setProblems) {
- if ($problemRecord->status != 1 || $problemRecord->num_incorrect != 0) {
- $allcorrect = 0;
- last;
- }
- }
-
- if ($allcorrect) {
- return 1;
- } else {
- return 0;
- }
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/speed_mather.at b/courses.dist/modelCourse/templates/achievements/speed_mather.at
deleted file mode 100644
index e251c0aac..000000000
--- a/courses.dist/modelCourse/templates/achievements/speed_mather.at
+++ /dev/null
@@ -1,89 +0,0 @@
-#This checks to see if the student has finished the whole set in
-# less than 10 minutes from time to first input to time to last answer.
-
-# If the set id doest equal the id of the last set then set
-# *this* set as the last set, and set the start time
-
-if ($problem->set_id ne $localData->{last_set}) {
- $localData->{last_set} = $problem->set_id;
- $localData->{start_time} = time();
- return 0;
-}
-
-# of we spent more than 10 minutes on the set then leave
-if ((time() - $localData->{start_time}) > 3600) {
- return 0;
-} else { #if it is check to see if we have finished the set
-
- foreach my $problemRecord (@setProblems) {
- if ($problemRecord->status != 1) {
- return 0;
- }
- }
-
- #the set is done so we are finished
- return 1;
-}
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/still_not_right.at b/courses.dist/modelCourse/templates/achievements/still_not_right.at
deleted file mode 100644
index cccacee82..000000000
--- a/courses.dist/modelCourse/templates/achievements/still_not_right.at
+++ /dev/null
@@ -1,85 +0,0 @@
-# checks to see if the student has inputted the same answer many times in a
-# row. Because the $problem-last_answer field is updated *after* the
-# achievements are evaluated, this acheivement will pop up late.
-
- $localData->{incorrect_streak} = 0 unless $localData->{incorrect_streak};
-
- if ($problem->status == 1) {
- return 0;
- } elsif ($problem->set_id ne $localData->{set_id} ||
- $problem->problem_id ne $localData->{problem_id} ||
- $problem->last_answer ne $localData->{last_answer}) {
- $localData->{set_id} = $problem->set_id;
- $localData->{problem_id} = $problem->problem_id;
- $localData->{last_answer} = $problem->last_answer;
- $localData->{incorrect_streak} = 1;
- return 0;
- } elsif ($localData->{incorrect_streak} == 9) {
- return 1;
- } else {
- $localData->{incorrect_streak}++;
- return 0;
- }
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/super_persistance.at b/courses.dist/modelCourse/templates/achievements/super_persistance.at
deleted file mode 100644
index 931b2e6ec..000000000
--- a/courses.dist/modelCourse/templates/achievements/super_persistance.at
+++ /dev/null
@@ -1,72 +0,0 @@
-#This checks to see if the student has solved the problem after a certain
-# number of incorrect attempts
-
- if ($problem->status == 1 && $problem->num_incorrect >= 100) {
- return 1
- } else {
- return 0;
- }
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/super_speed_math.at b/courses.dist/modelCourse/templates/achievements/super_speed_math.at
deleted file mode 100644
index 9e121de52..000000000
--- a/courses.dist/modelCourse/templates/achievements/super_speed_math.at
+++ /dev/null
@@ -1,89 +0,0 @@
-#This checks to see if the student has finished the whole set in
-# less than 10 minutes from time to first input to time to last answer.
-
-# If the set id doest equal the id of the last set then set
-# *this* set as the last set, and set the start time
-
-if ($problem->set_id ne $localData->{last_set}) {
- $localData->{last_set} = $problem->set_id;
- $localData->{start_time} = time();
- return 0;
-}
-
-# of we spent more than 10 minutes on the set then leave
-if ((time() - $localData->{start_time}) > 600) {
- return 0;
-} else { #if it is check to see if we have finished the set
-
- foreach my $problemRecord (@setProblems) {
- if ($problemRecord->status != 1) {
- return 0;
- }
- }
-
- #the set is done so we are finished
- return 1;
-}
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/taylor_hero.at b/courses.dist/modelCourse/templates/achievements/taylor_hero.at
deleted file mode 100644
index e637e74ca..000000000
--- a/courses.dist/modelCourse/templates/achievements/taylor_hero.at
+++ /dev/null
@@ -1,84 +0,0 @@
-#This problem checks to see if a particular problem from a list of valid
-# sets and problems has been solved. (You would edit this file to say which
-# sets and problems count.)
-
-#constants
-my %validproblems = (
- 'SetNameHere' => { #now you show which problems are valid like:
- '2' => 1,
- '1' => 1, }, #and put more sets here
- );
-
-#check and see if this problem was solved
-if ($validproblems{$problem->set_id} &&
- $validproblems{$problem->set_id}{$problem->problem_id} &&
- $problem->status == 1 &&
- $problem->num_correct == 1) {
- return 1;
- }
-
- return 0;
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/the_fundamentals.at b/courses.dist/modelCourse/templates/achievements/the_fundamentals.at
deleted file mode 100644
index e637e74ca..000000000
--- a/courses.dist/modelCourse/templates/achievements/the_fundamentals.at
+++ /dev/null
@@ -1,84 +0,0 @@
-#This problem checks to see if a particular problem from a list of valid
-# sets and problems has been solved. (You would edit this file to say which
-# sets and problems count.)
-
-#constants
-my %validproblems = (
- 'SetNameHere' => { #now you show which problems are valid like:
- '2' => 1,
- '1' => 1, }, #and put more sets here
- );
-
-#check and see if this problem was solved
-if ($validproblems{$problem->set_id} &&
- $validproblems{$problem->set_id}{$problem->problem_id} &&
- $problem->status == 1 &&
- $problem->num_correct == 1) {
- return 1;
- }
-
- return 0;
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/the_lhopital.at b/courses.dist/modelCourse/templates/achievements/the_lhopital.at
deleted file mode 100644
index e637e74ca..000000000
--- a/courses.dist/modelCourse/templates/achievements/the_lhopital.at
+++ /dev/null
@@ -1,84 +0,0 @@
-#This problem checks to see if a particular problem from a list of valid
-# sets and problems has been solved. (You would edit this file to say which
-# sets and problems count.)
-
-#constants
-my %validproblems = (
- 'SetNameHere' => { #now you show which problems are valid like:
- '2' => 1,
- '1' => 1, }, #and put more sets here
- );
-
-#check and see if this problem was solved
-if ($validproblems{$problem->set_id} &&
- $validproblems{$problem->set_id}{$problem->problem_id} &&
- $problem->status == 1 &&
- $problem->num_correct == 1) {
- return 1;
- }
-
- return 0;
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/third_time.at b/courses.dist/modelCourse/templates/achievements/third_time.at
deleted file mode 100644
index 36572713a..000000000
--- a/courses.dist/modelCourse/templates/achievements/third_time.at
+++ /dev/null
@@ -1,71 +0,0 @@
-#This checks to see if the student has a certain number of attempts
-
- if ($problem->num_correct == 1 and $problem->num_incorrect == 2) {
- return 1;
- } else {
- return 0;
- }
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
\ No newline at end of file
diff --git a/courses.dist/modelCourse/templates/achievements/three_in_a_row.at b/courses.dist/modelCourse/templates/achievements/three_in_a_row.at
deleted file mode 100644
index b97b53c83..000000000
--- a/courses.dist/modelCourse/templates/achievements/three_in_a_row.at
+++ /dev/null
@@ -1,82 +0,0 @@
-#This checks to see if the student has solved 10 problems without having any
-# incorrect answers
-
-# reset counter if they got something wrong
-if ($problem->status < 1) {
- $counter = 0;
- return 0;
-# if they are right update the counter
-} elsif ($problem->status == 1 &&
- $problem->num_correct == 1 &&
- $problem->num_incorrect == 0 ) {
- $counter++;
-}
-
-if ($counter >= $maxCounter) {
- return 1;
-} else {
- return 0;
-}
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/to_infinity.at b/courses.dist/modelCourse/templates/achievements/to_infinity.at
deleted file mode 100644
index e637e74ca..000000000
--- a/courses.dist/modelCourse/templates/achievements/to_infinity.at
+++ /dev/null
@@ -1,84 +0,0 @@
-#This problem checks to see if a particular problem from a list of valid
-# sets and problems has been solved. (You would edit this file to say which
-# sets and problems count.)
-
-#constants
-my %validproblems = (
- 'SetNameHere' => { #now you show which problems are valid like:
- '2' => 1,
- '1' => 1, }, #and put more sets here
- );
-
-#check and see if this problem was solved
-if ($validproblems{$problem->set_id} &&
- $validproblems{$problem->set_id}{$problem->problem_id} &&
- $problem->status == 1 &&
- $problem->num_correct == 1) {
- return 1;
- }
-
- return 0;
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/courses.dist/modelCourse/templates/achievements/trig_ninja.at b/courses.dist/modelCourse/templates/achievements/trig_ninja.at
deleted file mode 100644
index e637e74ca..000000000
--- a/courses.dist/modelCourse/templates/achievements/trig_ninja.at
+++ /dev/null
@@ -1,84 +0,0 @@
-#This problem checks to see if a particular problem from a list of valid
-# sets and problems has been solved. (You would edit this file to say which
-# sets and problems count.)
-
-#constants
-my %validproblems = (
- 'SetNameHere' => { #now you show which problems are valid like:
- '2' => 1,
- '1' => 1, }, #and put more sets here
- );
-
-#check and see if this problem was solved
-if ($validproblems{$problem->set_id} &&
- $validproblems{$problem->set_id}{$problem->problem_id} &&
- $problem->status == 1 &&
- $problem->num_correct == 1) {
- return 1;
- }
-
- return 0;
-
-
-# -You have access to a variety of variables:
-# - $problem : the problem data (changes to this variable will not be saved!)
-# This variable contains the problem data. It is a hash pointer with the
-# following values (not all values shown)
-# - $problem->status : the score of the current problem
-# - $problem->problem_id : the id of the current problem
-# - $problem->set_id : the id of the set containing the problem
-# - $problem->num_correct : the number of correct attempts
-# - $problem->num_incorrect : the number of incorrect attempts
-# - $problem->last_answer : the last answer submitted
-# - $problem->max_attempts : the maximum number of allowed attempts
-#
-# - $set : the set data (changes to this variable will not be saved!)
-# This variable contains the set data. it is a hash pointer with the
-# following values. (not all values shown)
-# - $set->open_date : when the set was open
-# - $set->due_date : when the set is due
-#
-# - @setProblems : the problem data for all the problems from this set.
-# (changes to this variable will not be saved!)
-# This is an array of problem hashes. Each element of the array has the
-# save hash keys as the $problem variable above
-#
-# - $counter : the users counter associated to this achievement
-# (changes to this variable *will* be saved!)
-# If this achievement has a counter associated to it (i.e. solve 20 problems)
-# then this is where you store the students counter for this achievement.
-# This variable will initally start as ''
-#
-# - $maxCounter : the goal for the $counter variable for this achievement
-# (changes to this variable will not be saved!)
-# If this achievement has a counter associated to it then this variable
-# contains the goal for the counter. Your achievement should return 1
-# when $counter >= $maxCounter. These two variables are used to show a
-# progress bar for the achievement.
-#
-# - $localData : this is a hash which stores data for this user and achievement
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation. You can store whatever
-# you like in here and it can be accessed next time this evaluator is run.
-# Two things to keep in mind. The data in this hash will *not* be accessable
-# by other achievements. If you plan to store something in this hash you have
-# to write code to initialize the data.
-#
-# - $globalData : this is a hash which stores data for all achievements
-# (changes to this variable *will* be saved!)
-# This hash will persist from evaluation to evaluation and, like $localData,
-# you can store whatever you like in here. This data will be accessable from
-# *every* achievement and is unique to the user. Like $localData, you need to
-# initialize any variable you plan on using in this hash. There are two
-# variables stored in this hash that are maintained by the system.
-# - $globalData->{completeSets} : This is the number of sets which the student
-# has earned 100% on
-# - $globalData->{completeProblems} : This is the number of problems which the
-# student has earned 100% on
-# Warning: The achievements are always evaluated in the order they are listed
-# on the Instructors achievement editor page. To make matters more
-# complicated, achievements which have already been earned are not evaluated
-# at all. The up-shot of this is that when modifying variables in
-# $globalData you need to either write your code so it doesnt matter which
-# order the evaluators are run in, or you need to pay very close attention
-# to which evaluators are run and when.
diff --git a/htdocs/codemirror2/LICENSE b/htdocs/codemirror2/LICENSE
new file mode 100644
index 000000000..3f7c0bb18
--- /dev/null
+++ b/htdocs/codemirror2/LICENSE
@@ -0,0 +1,19 @@
+Copyright (C) 2011 by Marijn Haverbeke
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/htdocs/codemirror2/README.md b/htdocs/codemirror2/README.md
new file mode 100644
index 000000000..624b5409b
--- /dev/null
+++ b/htdocs/codemirror2/README.md
@@ -0,0 +1,6 @@
+# CodeMirror 2
+
+CodeMirror 2 is a rewrite of [CodeMirror
+1](http://github.com/marijnh/CodeMirror). The docs live
+[here](http://codemirror.net/2/manual.html), and the project page is
+[http://codemirror.net/2/](http://codemirror.net/2/).
diff --git a/htdocs/codemirror2/codeshard.html b/htdocs/codemirror2/codeshard.html
new file mode 100644
index 000000000..b37bbb19a
--- /dev/null
+++ b/htdocs/codemirror2/codeshard.html
@@ -0,0 +1,18 @@
+
+
+
+CodeShard
+
+
+
+
CodeShard
+
+
A minimal version of CodeMirror, designed to edit single lines of code at a time.
To optimize loading CodeMirror, especially when including a
+ bunch of different modes, it is recommended that you combine and
+ minify (and preferably also gzip) the scripts. This page makes
+ those first two steps very easy. Simply select the version and
+ scripts you need in the form below, and
+ click Compress to download the minified script
+ file.
Demonstration of a mode that parses HTML, highlighting
+ the Mustache templating
+ directives inside of it by using the code
+ in overlay.js. View
+ source to see the 15 lines of code needed to accomplish this.
By setting a single CSS property, CodeMirror can be made to
+automatically resize to fit the content. Use max-height
+to prevent it from growing past a given point (on halfway modern
+browsers).
CodeMirror is a JavaScript library that can
+ be used to create a relatively pleasant editor interface for
+ code-like content ― computer programs, HTML markup, and
+ similar. If a mode has been written for the language you are
+ editing, the code will be coloured, and the editor will optionally
+ help you with indentation.
+
+
This is the project page for CodeMirror 2, the currently more
+ actively developed, and recommended
+ version. CodeMirror 1 is still available
+ from here.
CodeMirror can also be found on GitHub at marijnh/CodeMirror2.
+ If you plan to hack on the code and contribute patches, the best way
+ to do it is to create a GitHub fork, and send pull requests.
+
+
Documentation
+
+
The manual is your first stop for
+ learning how to use this library. It starts with a quick explanation
+ of how to use the editor, and then describes all of the (many)
+ options and methods that CodeMirror exposes.
+
+
For those who want to learn more about the code, there is
+ an overview of the internals available.
+ The source code
+ itself is, for the most part, also well commented.
+
+
Support and bug reports
+
+
There is
+ a Google
+ group (a sort of mailing list/newsgroup thing) for discussion
+ and news related to CodeMirror. Reporting bugs is best done
+ on github.
+ You can also e-mail me
+ directly: Marijn
+ Haverbeke.
+
+
Supported browsers
+
+
The following browsers are able to run CodeMirror:
+
+
+
Firefox 2 or higher
+
Chrome, any version
+
Safari 3 or higher
+
Internet Explorer 6 or higher
+
Opera 9 or higher (with some key-handling problems on OS X)
+
+
+
I am not actively testing against every new browser release, and
+ vendors have a habit of introducing bugs all the time, so I am
+ relying on the community to tell me when something breaks.
+ See here for information on how to contact
+ me.
CodeMirror 2 is a complete rewrite that's
+ faster, smaller, simpler to use, and less dependent on browser
+ quirks. See this
+ and this
+ for more information.
+
+
This is a followup to
+my Brutal Odyssey to the
+Dark Side of the DOM Tree story. That one describes the
+mind-bending process of implementing (what would become) CodeMirror 1.
+This one describes the internals of CodeMirror 2, a complete rewrite
+and rethink of the old code base. I wanted to give this piece another
+Hunter Thompson copycat subtitle, but somehow that would be out of
+place—the process this time around was one of straightforward
+engineering, requiring no serious mind-bending whatsoever.
+
+
So, what is wrong with CodeMirror 1? I'd estimate, by mailing list
+activity and general search-engine presence, that it has been
+integrated into about a thousand systems by now. The most prominent
+one, since a few weeks,
+being Google
+code's project hosting. It works, and it's being used widely.
+
+
Still, I did not start replacing it because I was bored. CodeMirror
+1 was heavily reliant on designMode
+or contentEditable (depending on the browser). Neither of
+these are well specified (HTML5 tries
+to specify
+their basics), and, more importantly, they tend to be one of the more
+obscure and buggy areas of browser functionality—CodeMirror, by using
+this functionality in a non-typical way, was constantly running up
+against browser bugs. WebKit wouldn't show an empty line at the end of
+the document, and in some releases would suddenly get unbearably slow.
+Firefox would show the cursor in the wrong place. Internet Explorer
+would insist on linkifying everything that looked like a URL or email
+address, a behaviour that can't be turned off. Some bugs I managed to
+work around (which was often a frustrating, painful process), others,
+such as the Firefox cursor placement, I gave up on, and had to tell
+user after user that they were known problems, but not something I
+could help.
+
+
Also, there is the fact that designMode (which seemed
+to be less buggy than contentEditable in Webkit and
+Firefox, and was thus used by CodeMirror 1 in those browsers) requires
+a frame. Frames are another tricky area. It takes some effort to
+prevent getting tripped up by domain restrictions, they don't
+initialize synchronously, behave strangely in response to the back
+button, and, on several browsers, can't be moved around the DOM
+without having them re-initialize. They did provide a very nice way to
+namespace the library, though—CodeMirror 1 could freely pollute the
+namespace inside the frame.
+
+
Finally, working with an editable document means working with
+selection in arbitrary DOM structures. Internet Explorer (8 and
+before) has an utterly different (and awkward) selection API than all
+of the other browsers, and even among the different implementations of
+document.selection, details about how exactly a selection
+is represented vary quite a bit. Add to that the fact that Opera's
+selection support tended to be very buggy until recently, and you can
+imagine why CodeMirror 1 contains 700 lines of selection-handling
+code.
+
+
And that brings us to the main issue with the CodeMirror 1
+code base: The proportion of browser-bug-workarounds to real
+application code was getting dangerously high. By building on top of a
+few dodgy features, I put the system in a vulnerable position—any
+incompatibility and bugginess in these features, I had to paper over
+with my own code. Not only did I have to do some serious stunt-work to
+get it to work on older browsers (as detailed in the
+previous story), things
+also kept breaking in newly released versions, requiring me to come up
+with new scary hacks in order to keep up. This was starting
+to lose its appeal.
+
+
General Approach
+
+
What CodeMirror 2 does is try to sidestep most of the hairy hacks
+that came up in version 1. I owe a lot to the
+ACE editor for inspiration on how to
+approach this.
+
+
I absolutely did not want to be completely reliant on key events to
+generate my input. Every JavaScript programmer knows that key event
+information is horrible and incomplete. Some people (most awesomely
+Mihai Bazon with Ymacs) have been able
+to build more or less functioning editors by directly reading key
+events, but it takes a lot of work (the kind of never-ending, fragile
+work I described earlier), and will never be able to properly support
+things like multi-keystoke international character input.
+
+
So what I do is focus a hidden textarea, and let the browser
+believe that the user is typing into that. What we show to the user is
+a DOM structure we built to represent his document. If this is updated
+quickly enough, and shows some kind of believable cursor, it feels
+like a real text-input control.
+
+
Another big win is that this DOM representation does not have to
+span the whole document. Some CodeMirror 1 users insisted that they
+needed to put a 30 thousand line XML document into CodeMirror. Putting
+all that into the DOM takes a while, especially since, for some
+reason, an editable DOM tree is slower than a normal one on most
+browsers. If we have full control over what we show, we must only
+ensure that the visible part of the document has been added, and can
+do the rest only when needed. (Fortunately, the onscroll
+event works almost the same on all browsers, and lends itself well to
+displaying things only as they are scrolled into view.)
+
+
Input
+
+
ACE uses its hidden textarea only as a text input shim, and does
+all cursor movement and things like text deletion itself by directly
+handling key events. CodeMirror's way is to let the browser do its
+thing as much as possible, and not, for example, define its own set of
+key bindings. One way to do this would have been to have the whole
+document inside the hidden textarea, and after each key event update
+the display DOM to reflect what's in that textarea.
+
+
That'd be simple, but it is not realistic. For even medium-sized
+document the editor would be constantly munging huge strings, and get
+terribly slow. What CodeMirror 2 does is put the current selection,
+along with an extra line on the top and on the bottom, into the
+textarea.
+
+
This means that the arrow keys (and their ctrl-variations), home,
+end, etcetera, do not have to be handled specially. We just read the
+cursor position in the textarea, and update our cursor to match it.
+Also, copy and paste work pretty much for free, and people get their
+native key bindings, without any special work on my part. For example,
+I have emacs key bindings configured for Chrome and Firefox. There is
+no way for a script to detect this.
+
+
Of course, since only a small part of the document sits in the
+textarea, keys like page up and ctrl-end won't do the right thing.
+CodeMirror is catching those events and handling them itself.
+
+
Selection
+
+
Getting and setting the selection range of a textarea in modern
+browsers is trivial—you just use the selectionStart
+and selectionEnd properties. On IE you have to do some
+insane stuff with temporary ranges and compensating for the fact that
+moving the selection by a 'character' will treat \r\n as a single
+character, but even there it is possible to build functions that
+reliably set and get the selection range.
+
+
But consider this typical case: When I'm somewhere in my document,
+press shift, and press the up arrow, something gets selected. Then, if
+I, still holding shift, press the up arrow again, the top of my
+selection is adjusted. The selection remembers where its head
+and its anchor are, and moves the head when we shift-move.
+This is a generally accepted property of selections, and done right by
+every editing component built in the past twenty years.
+
+
But not something that the browser selection APIs expose.
+
+
Great. So when someone creates an 'upside-down' selection, the next
+time CodeMirror has to update the textarea, it'll re-create the
+selection as an 'upside-up' selection, with the anchor at the top, and
+the next cursor motion will behave in an unexpected way—our second
+up-arrow press in the example above will not do anything, since it is
+interpreted in exactly the same way as the first.
+
+
No problem. We'll just, ehm, detect that the selection is
+upside-down (you can tell by the way it was created), and then, when
+an upside-down selection is present, and a cursor-moving key is
+pressed in combination with shift, we quickly collapse the selection
+in the textarea to its start, allow the key to take effect, and then
+combine its new head with its old anchor to get the real
+selection.
+
+
In short, scary hacks could not be avoided entirely in CodeMirror
+2.
+
+
And, the observant reader might ask, how do you even know that a
+key combo is a cursor-moving combo, if you claim you support any
+native key bindings? Well, we don't, but we can learn. The editor
+keeps a set known cursor-movement combos (initialized to the
+predictable defaults), and updates this set when it observes that
+pressing a certain key had (only) the effect of moving the cursor.
+This, of course, doesn't work if the first time the key is used was
+for extending an inverted selection, but it works most of the
+time.
+
+
Intelligent Updating
+
+
One thing that always comes up when you have a complicated internal
+state that's reflected in some user-visible external representation
+(in this case, the displayed code and the textarea's content) is
+keeping the two in sync. The naive way is to just update the display
+every time you change your state, but this is not only error prone
+(you'll forget), it also easily leads to duplicate work on big,
+composite operations. Then you start passing around flags indicating
+whether the display should be updated in an attempt to be efficient
+again and, well, at that point you might as well give up completely.
+
+
I did go down that road, but then switched to a much simpler model:
+simply keep track of all the things that have been changed during an
+action, and then, only at the end, use this information to update the
+user-visible display.
+
+
CodeMirror uses a concept of operations, which start by
+calling a specific set-up function that clears the state and end by
+calling another function that reads this state and does the required
+updating. Most event handlers, and all the user-visible methods that
+change state are wrapped like this. There's a method
+called operation that accepts a function, and returns
+another function that wraps the given function as an operation.
+
+
It's trivial to extend this (as CodeMirror does) to detect nesting,
+and, when an operation is started inside an operation, simply
+increment the nesting count, and only do the updating when this count
+reaches zero again.
+
+
If we have a set of changed ranges and know the currently shown
+range, we can (with some awkward code to deal with the fact that
+changes can add and remove lines, so we're dealing with a changing
+coordinate system) construct a map of the ranges that were left
+intact. We can then compare this map with the part of the document
+that's currently visible (based on scroll offset and editor height) to
+determine whether something needs to be updated.
+
+
CodeMirror uses two update algorithms—a full refresh, where it just
+discards the whole part of the DOM that contains the edited text and
+rebuilds it, and a patch algorithm, where it uses the information
+about changed and intact ranges to update only the out-of-date parts
+of the DOM. When more than 30 percent (which is the current heuristic,
+might change) of the lines need to be updated, the full refresh is
+chosen (since it's faster to do than painstakingly finding and
+updating all the changed lines), in the other case it does the
+patching (so that, if you scroll a line or select another character,
+the whole screen doesn't have to be re-rendered).
+
+
All updating uses innerHTML rather than direct DOM
+manipulation, since that still seems to be by far the fastest way to
+build documents. There's a per-line function that combines the
+highlighting, marking, and
+selection info for that line into a snippet of HTML. The patch updater
+uses this to reset individual lines, the refresh updater builds an
+HTML chunk for the whole visible document at once, and then uses a
+single innerHTML update to do the refresh.
+
+
Parsers can be Simple
+
+
When I wrote CodeMirror 1, I
+thought interruptable
+parsers were a hugely scary and complicated thing, and I used a
+bunch of heavyweight abstractions to keep this supposed complexity
+under control: parsers
+were iterators
+that consumed input from another iterator, and used funny
+closure-resetting tricks to copy and resume themselves.
+
+
This made for a rather nice system, in that parsers formed strictly
+separate modules, and could be composed in predictable ways.
+Unfortunately, it was quite slow (stacking three or four iterators on
+top of each other), and extremely intimidating to people not used to a
+functional programming style.
+
+
With a few small changes, however, we can keep all those
+advantages, but simplify the API and make the whole thing less
+indirect and inefficient. CodeMirror
+2's mode API uses explicit state
+objects, and makes the parser/tokenizer a function that simply takes a
+state and a character stream abstraction, advances the stream one
+token, and returns the way the token should be styled. This state may
+be copied, optionally in a mode-defined way, in order to be able to
+continue a parse at a given point. Even someone who's never touched a
+lambda in his life can understand this approach. Additionally, far
+fewer objects are allocated in the course of parsing now.
+
+
The biggest speedup comes from the fact that the parsing no longer
+has to touch the DOM though. In CodeMirror 1, on an older browser, you
+could see the parser work its way through the document,
+managing some twenty lines in each 50-millisecond time slice it got. It
+was reading its input from the DOM, and updating the DOM as it went
+along, which any experienced JavaScript programmer will immediately
+spot as a recipe for slowness. In CodeMirror 2, the parser usually
+finishes the whole document in a single 100-millisecond time slice—it
+manages some 1500 lines during that time on Chrome. All it has to do
+is munge strings, so there is no real reason for it to be slow
+anymore.
+
+
What Gives?
+
+
Given all this, what can you expect from CodeMirror 2? First, the
+good:
+
+
+
+
Small. the base library is some 32k when minified
+now, 12k when gzipped. It's smaller than its own logo.
+
+
Lightweight. CodeMirror 2 initializes very
+quickly, and does almost no work when it is not focused. This means
+you can treat it almost like a textarea, have multiple instances on a
+page without trouble.
+
+
Huge document support. Since highlighting is
+really fast, and no DOM structure is being built for non-visible
+content, you don't have to worry about locking up your browser when a
+user enters a megabyte-sized document.
+
+
Extended API. Some things kept coming up in the
+mailing list, such as marking pieces of text or lines, which were
+extremely hard to do with CodeMirror 1. The new version has proper
+support for these built in.
+
+
Tab support. Tabs inside editable documents were,
+for some reason, a no-go. At least six different people announced they
+were going to add tab support to CodeMirror 1, none survived (I mean,
+none delivered a working version). CodeMirror 2 no longer removes tabs
+from your document.
+
+
Sane styling.iframe nodes aren't
+really known for respecting document flow. Now that an editor instance
+is a plain div element, it is much easier to size it to
+fit the surrounding elements. You don't even have to make it scroll if
+you do not want to.
+
+
+
+
Then, the bad:
+
+
+
+
No line-wrapping. I'd have liked to get
+line-wrapping to work, but it doesn't match the model I'm using very
+well. It is important that cursor movement in the textarea matches
+what you see on the screen, and it seems to be impossible to have the
+lines wrapped the same in the textarea and the normal DOM.
+
+
Some cursor flakiness. The textarea hack does not
+really do justice to the complexity of cursor handling—a selection is
+typically more than just an offset into a string. For example, if you
+use the up and down arrow keys to move to a shorter line and then
+back, you'll end up in your old position in most editor controls, but
+CodeMirror 2 currently doesn't remember the 'real' cursor column in
+this case. These can be worked around on a case-by-case basis, but
+I haven't put much energy into that yet.
+
+
+
+
diff --git a/htdocs/codemirror2/lib/codemirror.css b/htdocs/codemirror2/lib/codemirror.css
new file mode 100644
index 000000000..d93e72d74
--- /dev/null
+++ b/htdocs/codemirror2/lib/codemirror.css
@@ -0,0 +1,67 @@
+.CodeMirror {
+ line-height: 1em;
+ font-family: monospace;
+}
+
+.CodeMirror-scroll {
+ overflow: auto;
+ height: 300px;
+ /* This is needed to prevent an IE[67] bug where the scrolled content
+ is visible outside of the scrolling box. */
+ position: relative;
+}
+
+.CodeMirror-gutter {
+ position: absolute; left: 0; top: 0;
+ background-color: #f7f7f7;
+ border-right: 1px solid #eee;
+ min-width: 2em;
+ height: 100%;
+}
+.CodeMirror-gutter-text {
+ color: #aaa;
+ text-align: right;
+ padding: .4em .2em .4em .4em;
+}
+.CodeMirror-lines {
+ padding: .4em;
+}
+
+.CodeMirror pre {
+ -moz-border-radius: 0;
+ -webkit-border-radius: 0;
+ -o-border-radius: 0;
+ border-radius: 0;
+ border-width: 0; margin: 0; padding: 0; background: transparent;
+ font-family: inherit;
+ font-size: inherit;
+ padding: 0; margin: 0;
+ white-space: pre;
+ word-wrap: normal;
+}
+
+.CodeMirror textarea {
+ font-family: inherit !important;
+ font-size: inherit !important;
+}
+
+.CodeMirror-cursor {
+ z-index: 10;
+ position: absolute;
+ visibility: hidden;
+ border-left: 1px solid black !important;
+}
+.CodeMirror-focused .CodeMirror-cursor {
+ visibility: visible;
+}
+
+span.CodeMirror-selected {
+ background: #ccc !important;
+ color: HighlightText !important;
+}
+.CodeMirror-focused span.CodeMirror-selected {
+ background: Highlight !important;
+}
+
+.CodeMirror-matchingbracket {color: #0f0 !important;}
+.CodeMirror-nonmatchingbracket {color: #f22 !important;}
diff --git a/htdocs/codemirror2/lib/codemirror.js b/htdocs/codemirror2/lib/codemirror.js
new file mode 100644
index 000000000..5b03c8b63
--- /dev/null
+++ b/htdocs/codemirror2/lib/codemirror.js
@@ -0,0 +1,2152 @@
+// All functions that need access to the editor's state live inside
+// the CodeMirror function. Below that, at the bottom of the file,
+// some utilities are defined.
+
+// CodeMirror is the only global var we claim
+var CodeMirror = (function() {
+ // This is the function that produces an editor instance. It's
+ // closure is used to store the editor state.
+ function CodeMirror(place, givenOptions) {
+ // Determine effective options based on given values and defaults.
+ var options = {}, defaults = CodeMirror.defaults;
+ for (var opt in defaults)
+ if (defaults.hasOwnProperty(opt))
+ options[opt] = (givenOptions && givenOptions.hasOwnProperty(opt) ? givenOptions : defaults)[opt];
+
+ var targetDocument = options["document"];
+ // The element in which the editor lives.
+ var wrapper = targetDocument.createElement("div");
+ wrapper.className = "CodeMirror";
+ // This mess creates the base DOM structure for the editor.
+ wrapper.innerHTML =
+ '
' + // Wraps and hides input textarea
+ '
' +
+ '
' +
+ '
' + // Set to the height of the text, causes scrolling
+ '' +
+ '
' + // Moved around its parent to cover visible view
+ '
' +
+ // Provides positioning relative to (visible) text origin
+ '
' +
+ '
' + // Absolutely positioned blinky cursor
+ '' + // This DIV contains the actual code
+ '
';
+ if (place.appendChild) place.appendChild(wrapper); else place(wrapper);
+ // I've never seen more elegant code in my life.
+ var inputDiv = wrapper.firstChild, input = inputDiv.firstChild,
+ scroller = wrapper.lastChild, code = scroller.firstChild,
+ measure = code.firstChild, mover = measure.nextSibling,
+ gutter = mover.firstChild, gutterText = gutter.firstChild,
+ lineSpace = gutter.nextSibling.firstChild,
+ cursor = lineSpace.firstChild, lineDiv = cursor.nextSibling;
+ if (options.tabindex != null) input.tabindex = options.tabindex;
+ if (!options.gutter && !options.lineNumbers) gutter.style.display = "none";
+
+ // Delayed object wrap timeouts, making sure only one is active. blinker holds an interval.
+ var poll = new Delayed(), highlight = new Delayed(), blinker;
+
+ // mode holds a mode API object. lines an array of Line objects
+ // (see Line constructor), work an array of lines that should be
+ // parsed, and history the undo history (instance of History
+ // constructor).
+ var mode, lines = [new Line("")], work, history = new History(), focused;
+ loadMode();
+ // The selection. These are always maintained to point at valid
+ // positions. Inverted is used to remember that the user is
+ // selecting bottom-to-top.
+ var sel = {from: {line: 0, ch: 0}, to: {line: 0, ch: 0}, inverted: false};
+ // Selection-related flags. shiftSelecting obviously tracks
+ // whether the user is holding shift. reducedSelection is a hack
+ // to get around the fact that we can't create inverted
+ // selections. See below.
+ var shiftSelecting, reducedSelection, lastDoubleClick;
+ // Variables used by startOperation/endOperation to track what
+ // happened during the operation.
+ var updateInput, changes, textChanged, selectionChanged, leaveInputAlone;
+ // Current visible range (may be bigger than the view window).
+ var showingFrom = 0, showingTo = 0, lastHeight = 0, curKeyId = null;
+ // editing will hold an object describing the things we put in the
+ // textarea, to help figure out whether something changed.
+ // bracketHighlighted is used to remember that a backet has been
+ // marked.
+ var editing, bracketHighlighted;
+ // Tracks the maximum line length so that the horizontal scrollbar
+ // can be kept static when scrolling.
+ var maxLine = "", maxWidth;
+
+ // Initialize the content.
+ operation(function(){setValue(options.value || ""); updateInput = false;})();
+
+ // Register our event handlers.
+ connect(scroller, "mousedown", operation(onMouseDown));
+ // Gecko browsers fire contextmenu *after* opening the menu, at
+ // which point we can't mess with it anymore. Context menu is
+ // handled in onMouseDown for Gecko.
+ if (!gecko) connect(scroller, "contextmenu", onContextMenu);
+ connect(code, "dblclick", operation(onDblClick));
+ connect(scroller, "scroll", function() {updateDisplay([]); if (options.onScroll) options.onScroll(instance);});
+ connect(window, "resize", function() {updateDisplay(true);});
+ connect(input, "keyup", operation(onKeyUp));
+ connect(input, "keydown", operation(onKeyDown));
+ connect(input, "keypress", operation(onKeyPress));
+ connect(input, "focus", onFocus);
+ connect(input, "blur", onBlur);
+
+ connect(scroller, "dragenter", e_stop);
+ connect(scroller, "dragover", e_stop);
+ connect(scroller, "drop", operation(onDrop));
+ connect(scroller, "paste", function(){focusInput(); fastPoll();});
+ connect(input, "paste", function(){fastPoll();});
+ connect(input, "cut", function(){fastPoll();});
+
+ // IE throws unspecified error in certain cases, when
+ // trying to access activeElement before onload
+ var hasFocus; try { hasFocus = (targetDocument.activeElement == input); } catch(e) { }
+ if (hasFocus) setTimeout(onFocus, 20);
+ else onBlur();
+
+ function isLine(l) {return l >= 0 && l < lines.length;}
+ // The instance object that we'll return. Mostly calls out to
+ // local functions in the CodeMirror function. Some do some extra
+ // range checking and/or clipping. operation is used to wrap the
+ // call so that changes it makes are tracked, and the display is
+ // updated afterwards.
+ var instance = {
+ getValue: getValue,
+ setValue: operation(setValue),
+ getSelection: getSelection,
+ replaceSelection: operation(replaceSelection),
+ focus: function(){focusInput(); onFocus(); fastPoll();},
+ setOption: function(option, value) {
+ options[option] = value;
+ if (option == "lineNumbers" || option == "gutter") gutterChanged();
+ else if (option == "mode" || option == "indentUnit") loadMode();
+ else if (option == "readOnly" && value == "nocursor") input.blur();
+ else if (option == "theme") scroller.className = scroller.className.replace(/cm-s-\w+/, "cm-s-" + value);
+ },
+ getOption: function(option) {return options[option];},
+ undo: operation(undo),
+ redo: operation(redo),
+ indentLine: operation(function(n, dir) {
+ if (isLine(n)) indentLine(n, dir == null ? "smart" : dir ? "add" : "subtract");
+ }),
+ historySize: function() {return {undo: history.done.length, redo: history.undone.length};},
+ matchBrackets: operation(function(){matchBrackets(true);}),
+ getTokenAt: function(pos) {
+ pos = clipPos(pos);
+ return lines[pos.line].getTokenAt(mode, getStateBefore(pos.line), pos.ch);
+ },
+ getStateAfter: function(line) {
+ line = clipLine(line == null ? lines.length - 1: line);
+ return getStateBefore(line + 1);
+ },
+ cursorCoords: function(start){
+ if (start == null) start = sel.inverted;
+ return pageCoords(start ? sel.from : sel.to);
+ },
+ charCoords: function(pos){return pageCoords(clipPos(pos));},
+ coordsChar: function(coords) {
+ var off = eltOffset(lineSpace);
+ var line = clipLine(Math.min(lines.length - 1, showingFrom + Math.floor((coords.y - off.top) / lineHeight())));
+ return clipPos({line: line, ch: charFromX(clipLine(line), coords.x - off.left)});
+ },
+ getSearchCursor: function(query, pos, caseFold) {return new SearchCursor(query, pos, caseFold);},
+ markText: operation(function(a, b, c){return operation(markText(a, b, c));}),
+ setMarker: addGutterMarker,
+ clearMarker: removeGutterMarker,
+ setLineClass: operation(setLineClass),
+ lineInfo: lineInfo,
+ addWidget: function(pos, node, scroll, where) {
+ pos = localCoords(clipPos(pos));
+ var top = pos.yBot, left = pos.x;
+ node.style.position = "absolute";
+ code.appendChild(node);
+ node.style.left = left + "px";
+ if (where == "over") top = pos.y;
+ else if (where == "near") {
+ var vspace = Math.max(scroller.offsetHeight, lines.length * lineHeight()),
+ hspace = Math.max(code.clientWidth, lineSpace.clientWidth) - paddingLeft();
+ if (pos.yBot + node.offsetHeight > vspace && pos.y > node.offsetHeight)
+ top = pos.y - node.offsetHeight;
+ if (left + node.offsetWidth > hspace)
+ left = hspace - node.offsetWidth;
+ }
+ node.style.top = (top + paddingTop()) + "px";
+ node.style.left = (left + paddingLeft()) + "px";
+ if (scroll)
+ scrollIntoView(left, top, left + node.offsetWidth, top + node.offsetHeight);
+ },
+
+ lineCount: function() {return lines.length;},
+ getCursor: function(start) {
+ if (start == null) start = sel.inverted;
+ return copyPos(start ? sel.from : sel.to);
+ },
+ somethingSelected: function() {return !posEq(sel.from, sel.to);},
+ setCursor: operation(function(line, ch) {
+ if (ch == null && typeof line.line == "number") setCursor(line.line, line.ch);
+ else setCursor(line, ch);
+ }),
+ setSelection: operation(function(from, to) {setSelection(clipPos(from), clipPos(to || from));}),
+ getLine: function(line) {if (isLine(line)) return lines[line].text;},
+ setLine: operation(function(line, text) {
+ if (isLine(line)) replaceRange(text, {line: line, ch: 0}, {line: line, ch: lines[line].text.length});
+ }),
+ removeLine: operation(function(line) {
+ if (isLine(line)) replaceRange("", {line: line, ch: 0}, clipPos({line: line+1, ch: 0}));
+ }),
+ replaceRange: operation(replaceRange),
+ getRange: function(from, to) {return getRange(clipPos(from), clipPos(to));},
+
+ operation: function(f){return operation(f)();},
+ refresh: function(){updateDisplay(true);},
+ getInputField: function(){return input;},
+ getWrapperElement: function(){return wrapper;},
+ getScrollerElement: function(){return scroller;},
+ getGutterElement: function(){return gutter;}
+ };
+
+ function setValue(code) {
+ history = null;
+ var top = {line: 0, ch: 0};
+ updateLines(top, {line: lines.length - 1, ch: lines[lines.length-1].text.length},
+ splitLines(code), top, top);
+ history = new History();
+ }
+ function getValue(code) {
+ var text = [];
+ for (var i = 0, l = lines.length; i < l; ++i)
+ text.push(lines[i].text);
+ return text.join("\n");
+ }
+
+ function onMouseDown(e) {
+ // Check whether this is a click in a widget
+ for (var n = e_target(e); n != wrapper; n = n.parentNode)
+ if (n.parentNode == code && n != mover) return;
+ var ld = lastDoubleClick; lastDoubleClick = null;
+ // First, see if this is a click in the gutter
+ for (var n = e_target(e); n != wrapper; n = n.parentNode)
+ if (n.parentNode == gutterText) {
+ if (options.onGutterClick)
+ options.onGutterClick(instance, indexOf(gutterText.childNodes, n) + showingFrom);
+ return e_preventDefault(e);
+ }
+
+ var start = posFromMouse(e);
+
+ switch (e_button(e)) {
+ case 3:
+ if (gecko && !mac) onContextMenu(e);
+ return;
+ case 2:
+ if (start) setCursor(start.line, start.ch, true);
+ return;
+ }
+ // For button 1, if it was clicked inside the editor
+ // (posFromMouse returning non-null), we have to adjust the
+ // selection.
+ if (!start) {if (e_target(e) == scroller) e_preventDefault(e); return;}
+
+ if (!focused) onFocus();
+ e_preventDefault(e);
+ if (ld && +new Date - ld < 400) return selectLine(start.line);
+
+ setCursor(start.line, start.ch, true);
+ var last = start, going;
+ // And then we have to see if it's a drag event, in which case
+ // the dragged-over text must be selected.
+ function end() {
+ focusInput();
+ updateInput = true;
+ move(); up();
+ }
+ function extend(e) {
+ var cur = posFromMouse(e, true);
+ if (cur && !posEq(cur, last)) {
+ if (!focused) onFocus();
+ last = cur;
+ setSelectionUser(start, cur);
+ updateInput = false;
+ var visible = visibleLines();
+ if (cur.line >= visible.to || cur.line < visible.from)
+ going = setTimeout(operation(function(){extend(e);}), 150);
+ }
+ }
+
+ var move = connect(targetDocument, "mousemove", operation(function(e) {
+ clearTimeout(going);
+ e_preventDefault(e);
+ extend(e);
+ }), true);
+ var up = connect(targetDocument, "mouseup", operation(function(e) {
+ clearTimeout(going);
+ var cur = posFromMouse(e);
+ if (cur) setSelectionUser(start, cur);
+ e_preventDefault(e);
+ end();
+ }), true);
+ }
+ function onDblClick(e) {
+ var pos = posFromMouse(e);
+ if (!pos) return;
+ selectWordAt(pos);
+ e_preventDefault(e);
+ lastDoubleClick = +new Date;
+ }
+ function onDrop(e) {
+ e.preventDefault();
+ var pos = posFromMouse(e, true), files = e.dataTransfer.files;
+ if (!pos || options.readOnly) return;
+ if (files && files.length && window.FileReader && window.File) {
+ function loadFile(file, i) {
+ var reader = new FileReader;
+ reader.onload = function() {
+ text[i] = reader.result;
+ if (++read == n) replaceRange(text.join(""), clipPos(pos), clipPos(pos));
+ };
+ reader.readAsText(file);
+ }
+ var n = files.length, text = Array(n), read = 0;
+ for (var i = 0; i < n; ++i) loadFile(files[i], i);
+ }
+ else {
+ try {
+ var text = e.dataTransfer.getData("Text");
+ if (text) replaceRange(text, pos, pos);
+ }
+ catch(e){}
+ }
+ }
+ function onKeyDown(e) {
+ if (!focused) onFocus();
+
+ var code = e.keyCode;
+ // IE does strange things with escape.
+ if (ie && code == 27) { e.returnValue = false; }
+ // Tries to detect ctrl on non-mac, cmd on mac.
+ var mod = (mac ? e.metaKey : e.ctrlKey) && !e.altKey, anyMod = e.ctrlKey || e.altKey || e.metaKey;
+ if (code == 16 || e.shiftKey) shiftSelecting = shiftSelecting || (sel.inverted ? sel.to : sel.from);
+ else shiftSelecting = null;
+ // First give onKeyEvent option a chance to handle this.
+ if (options.onKeyEvent && options.onKeyEvent(instance, addStop(e))) return;
+
+ if (code == 33 || code == 34) {scrollPage(code == 34); return e_preventDefault(e);} // page up/down
+ if (mod && ((code == 36 || code == 35) || // ctrl-home/end
+ mac && (code == 38 || code == 40))) { // cmd-up/down
+ scrollEnd(code == 36 || code == 38); return e_preventDefault(e);
+ }
+ if (mod && code == 65) {selectAll(); return e_preventDefault(e);} // ctrl-a
+ if (!options.readOnly) {
+ if (!anyMod && code == 13) {return;} // enter
+ if (!anyMod && code == 9 && handleTab(e.shiftKey)) return e_preventDefault(e); // tab
+ if (mod && code == 90) {undo(); return e_preventDefault(e);} // ctrl-z
+ if (mod && ((e.shiftKey && code == 90) || code == 89)) {redo(); return e_preventDefault(e);} // ctrl-shift-z, ctrl-y
+ }
+
+ // Key id to use in the movementKeys map. We also pass it to
+ // fastPoll in order to 'self learn'. We need this because
+ // reducedSelection, the hack where we collapse the selection to
+ // its start when it is inverted and a movement key is pressed
+ // (and later restore it again), shouldn't be used for
+ // non-movement keys.
+ curKeyId = (mod ? "c" : "") + (e.altKey ? "a" : "") + code;
+ if (sel.inverted && movementKeys[curKeyId] === true) {
+ var range = selRange(input);
+ if (range) {
+ reducedSelection = {anchor: range.start};
+ setSelRange(input, range.start, range.start);
+ }
+ }
+ // Don't save the key as a movementkey unless it had a modifier
+ if (!mod && !e.altKey) curKeyId = null;
+ fastPoll(curKeyId);
+ }
+ function onKeyUp(e) {
+ if (options.onKeyEvent && options.onKeyEvent(instance, addStop(e))) return;
+ if (reducedSelection) {
+ reducedSelection = null;
+ updateInput = true;
+ }
+ if (e.keyCode == 16) shiftSelecting = null;
+ }
+ function onKeyPress(e) {
+ if (options.onKeyEvent && options.onKeyEvent(instance, addStop(e))) return;
+ if (options.electricChars && mode.electricChars) {
+ var ch = String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode);
+ if (mode.electricChars.indexOf(ch) > -1)
+ setTimeout(operation(function() {indentLine(sel.to.line, "smart");}), 50);
+ }
+ var code = e.keyCode;
+ // Re-stop tab and enter. Necessary on some browsers.
+ if (code == 13) {if (!options.readOnly) handleEnter(); e_preventDefault(e);}
+ else if (!e.ctrlKey && !e.altKey && !e.metaKey && code == 9 && options.tabMode != "default") e_preventDefault(e);
+ else fastPoll(curKeyId);
+ }
+
+ function onFocus() {
+ if (options.readOnly == "nocursor") return;
+ if (!focused) {
+ if (options.onFocus) options.onFocus(instance);
+ focused = true;
+ if (wrapper.className.search(/\bCodeMirror-focused\b/) == -1)
+ wrapper.className += " CodeMirror-focused";
+ if (!leaveInputAlone) prepareInput();
+ }
+ slowPoll();
+ restartBlink();
+ }
+ function onBlur() {
+ if (focused) {
+ if (options.onBlur) options.onBlur(instance);
+ focused = false;
+ wrapper.className = wrapper.className.replace(" CodeMirror-focused", "");
+ }
+ clearInterval(blinker);
+ setTimeout(function() {if (!focused) shiftSelecting = null;}, 150);
+ }
+
+ // Replace the range from from to to by the strings in newText.
+ // Afterwards, set the selection to selFrom, selTo.
+ function updateLines(from, to, newText, selFrom, selTo) {
+ if (history) {
+ var old = [];
+ for (var i = from.line, e = to.line + 1; i < e; ++i) old.push(lines[i].text);
+ history.addChange(from.line, newText.length, old);
+ while (history.done.length > options.undoDepth) history.done.shift();
+ }
+ updateLinesNoUndo(from, to, newText, selFrom, selTo);
+ }
+ function unredoHelper(from, to) {
+ var change = from.pop();
+ if (change) {
+ var replaced = [], end = change.start + change.added;
+ for (var i = change.start; i < end; ++i) replaced.push(lines[i].text);
+ to.push({start: change.start, added: change.old.length, old: replaced});
+ var pos = clipPos({line: change.start + change.old.length - 1,
+ ch: editEnd(replaced[replaced.length-1], change.old[change.old.length-1])});
+ updateLinesNoUndo({line: change.start, ch: 0}, {line: end - 1, ch: lines[end-1].text.length}, change.old, pos, pos);
+ updateInput = true;
+ }
+ }
+ function undo() {unredoHelper(history.done, history.undone);}
+ function redo() {unredoHelper(history.undone, history.done);}
+
+ function updateLinesNoUndo(from, to, newText, selFrom, selTo) {
+ var recomputeMaxLength = false, maxLineLength = maxLine.length;
+ for (var i = from.line; i <= to.line; ++i) {
+ if (lines[i].text.length == maxLineLength) {recomputeMaxLength = true; break;}
+ }
+
+ var nlines = to.line - from.line, firstLine = lines[from.line], lastLine = lines[to.line];
+ // First adjust the line structure, taking some care to leave highlighting intact.
+ if (firstLine == lastLine) {
+ if (newText.length == 1)
+ firstLine.replace(from.ch, to.ch, newText[0]);
+ else {
+ lastLine = firstLine.split(to.ch, newText[newText.length-1]);
+ var spliceargs = [from.line + 1, nlines];
+ firstLine.replace(from.ch, firstLine.text.length, newText[0]);
+ for (var i = 1, e = newText.length - 1; i < e; ++i) spliceargs.push(new Line(newText[i]));
+ spliceargs.push(lastLine);
+ lines.splice.apply(lines, spliceargs);
+ }
+ }
+ else if (newText.length == 1) {
+ firstLine.replace(from.ch, firstLine.text.length, newText[0] + lastLine.text.slice(to.ch));
+ lines.splice(from.line + 1, nlines);
+ }
+ else {
+ var spliceargs = [from.line + 1, nlines - 1];
+ firstLine.replace(from.ch, firstLine.text.length, newText[0]);
+ lastLine.replace(0, to.ch, newText[newText.length-1]);
+ for (var i = 1, e = newText.length - 1; i < e; ++i) spliceargs.push(new Line(newText[i]));
+ lines.splice.apply(lines, spliceargs);
+ }
+
+
+ for (var i = from.line, e = i + newText.length; i < e; ++i) {
+ var l = lines[i].text;
+ if (l.length > maxLineLength) {
+ maxLine = l; maxLineLength = l.length; maxWidth = null;
+ recomputeMaxLength = false;
+ }
+ }
+ if (recomputeMaxLength) {
+ maxLineLength = 0; maxLine = ""; maxWidth = null;
+ for (var i = 0, e = lines.length; i < e; ++i) {
+ var l = lines[i].text;
+ if (l.length > maxLineLength) {
+ maxLineLength = l.length; maxLine = l;
+ }
+ }
+ }
+
+ // Add these lines to the work array, so that they will be
+ // highlighted. Adjust work lines if lines were added/removed.
+ var newWork = [], lendiff = newText.length - nlines - 1;
+ for (var i = 0, l = work.length; i < l; ++i) {
+ var task = work[i];
+ if (task < from.line) newWork.push(task);
+ else if (task > to.line) newWork.push(task + lendiff);
+ }
+ if (newText.length < 5) {
+ highlightLines(from.line, from.line + newText.length);
+ newWork.push(from.line + newText.length);
+ } else {
+ newWork.push(from.line);
+ }
+ work = newWork;
+ startWorker(100);
+ // Remember that these lines changed, for updating the display
+ changes.push({from: from.line, to: to.line + 1, diff: lendiff});
+ textChanged = {from: from, to: to, text: newText};
+
+ // Update the selection
+ function updateLine(n) {return n <= Math.min(to.line, to.line + lendiff) ? n : n + lendiff;}
+ setSelection(selFrom, selTo, updateLine(sel.from.line), updateLine(sel.to.line));
+
+ // Make sure the scroll-size div has the correct height.
+ code.style.height = (lines.length * lineHeight() + 2 * paddingTop()) + "px";
+ }
+
+ function replaceRange(code, from, to) {
+ from = clipPos(from);
+ if (!to) to = from; else to = clipPos(to);
+ code = splitLines(code);
+ function adjustPos(pos) {
+ if (posLess(pos, from)) return pos;
+ if (!posLess(to, pos)) return end;
+ var line = pos.line + code.length - (to.line - from.line) - 1;
+ var ch = pos.ch;
+ if (pos.line == to.line)
+ ch += code[code.length-1].length - (to.ch - (to.line == from.line ? from.ch : 0));
+ return {line: line, ch: ch};
+ }
+ var end;
+ replaceRange1(code, from, to, function(end1) {
+ end = end1;
+ return {from: adjustPos(sel.from), to: adjustPos(sel.to)};
+ });
+ return end;
+ }
+ function replaceSelection(code, collapse) {
+ replaceRange1(splitLines(code), sel.from, sel.to, function(end) {
+ if (collapse == "end") return {from: end, to: end};
+ else if (collapse == "start") return {from: sel.from, to: sel.from};
+ else return {from: sel.from, to: end};
+ });
+ }
+ function replaceRange1(code, from, to, computeSel) {
+ var endch = code.length == 1 ? code[0].length + from.ch : code[code.length-1].length;
+ var newSel = computeSel({line: from.line + code.length - 1, ch: endch});
+ updateLines(from, to, code, newSel.from, newSel.to);
+ }
+
+ function getRange(from, to) {
+ var l1 = from.line, l2 = to.line;
+ if (l1 == l2) return lines[l1].text.slice(from.ch, to.ch);
+ var code = [lines[l1].text.slice(from.ch)];
+ for (var i = l1 + 1; i < l2; ++i) code.push(lines[i].text);
+ code.push(lines[l2].text.slice(0, to.ch));
+ return code.join("\n");
+ }
+ function getSelection() {
+ return getRange(sel.from, sel.to);
+ }
+
+ var pollingFast = false; // Ensures slowPoll doesn't cancel fastPoll
+ function slowPoll() {
+ if (pollingFast) return;
+ poll.set(2000, function() {
+ startOperation();
+ readInput();
+ if (focused) slowPoll();
+ endOperation();
+ });
+ }
+ function fastPoll(keyId) {
+ var missed = false;
+ pollingFast = true;
+ function p() {
+ startOperation();
+ var changed = readInput();
+ if (changed && keyId) {
+ if (changed == "moved" && movementKeys[keyId] == null) movementKeys[keyId] = true;
+ if (changed == "changed") movementKeys[keyId] = false;
+ }
+ if (!changed && !missed) {missed = true; poll.set(80, p);}
+ else {pollingFast = false; slowPoll();}
+ endOperation();
+ }
+ poll.set(20, p);
+ }
+
+ // Inspects the textarea, compares its state (content, selection)
+ // to the data in the editing variable, and updates the editor
+ // content or cursor if something changed.
+ function readInput() {
+ if (leaveInputAlone || !focused) return;
+ var changed = false, text = input.value, sr = selRange(input);
+ if (!sr) return false;
+ var changed = editing.text != text, rs = reducedSelection;
+ var moved = changed || sr.start != editing.start || sr.end != (rs ? editing.start : editing.end);
+ if (!moved && !rs) return false;
+ if (changed) {
+ shiftSelecting = reducedSelection = null;
+ if (options.readOnly) {updateInput = true; return "changed";}
+ }
+
+ // Compute selection start and end based on start/end offsets in textarea
+ function computeOffset(n, startLine) {
+ var pos = 0;
+ for (;;) {
+ var found = text.indexOf("\n", pos);
+ if (found == -1 || (text.charAt(found-1) == "\r" ? found - 1 : found) >= n)
+ return {line: startLine, ch: n - pos};
+ ++startLine;
+ pos = found + 1;
+ }
+ }
+ var from = computeOffset(sr.start, editing.from),
+ to = computeOffset(sr.end, editing.from);
+ // Here we have to take the reducedSelection hack into account,
+ // so that you can, for example, press shift-up at the start of
+ // your selection and have the right thing happen.
+ if (rs) {
+ var head = sr.start == rs.anchor ? to : from;
+ var tail = shiftSelecting ? sel.to : sr.start == rs.anchor ? from : to;
+ if (sel.inverted = posLess(head, tail)) { from = head; to = tail; }
+ else { reducedSelection = null; from = tail; to = head; }
+ }
+
+ // In some cases (cursor on same line as before), we don't have
+ // to update the textarea content at all.
+ if (from.line == to.line && from.line == sel.from.line && from.line == sel.to.line && !shiftSelecting)
+ updateInput = false;
+
+ // Magic mess to extract precise edited range from the changed
+ // string.
+ if (changed) {
+ var start = 0, end = text.length, len = Math.min(end, editing.text.length);
+ var c, line = editing.from, nl = -1;
+ while (start < len && (c = text.charAt(start)) == editing.text.charAt(start)) {
+ ++start;
+ if (c == "\n") {line++; nl = start;}
+ }
+ var ch = nl > -1 ? start - nl : start, endline = editing.to - 1, edend = editing.text.length;
+ for (;;) {
+ c = editing.text.charAt(edend);
+ if (text.charAt(end) != c) {++end; ++edend; break;}
+ if (c == "\n") endline--;
+ if (edend <= start || end <= start) break;
+ --end; --edend;
+ }
+ var nl = editing.text.lastIndexOf("\n", edend - 1), endch = nl == -1 ? edend : edend - nl - 1;
+ updateLines({line: line, ch: ch}, {line: endline, ch: endch}, splitLines(text.slice(start, end)), from, to);
+ if (line != endline || from.line != line) updateInput = true;
+ }
+ else setSelection(from, to);
+
+ editing.text = text; editing.start = sr.start; editing.end = sr.end;
+ return changed ? "changed" : moved ? "moved" : false;
+ }
+
+ // Set the textarea content and selection range to match the
+ // editor state.
+ function prepareInput() {
+ var text = [];
+ var from = Math.max(0, sel.from.line - 1), to = Math.min(lines.length, sel.to.line + 2);
+ for (var i = from; i < to; ++i) text.push(lines[i].text);
+ text = input.value = text.join(lineSep);
+ var startch = sel.from.ch, endch = sel.to.ch;
+ for (var i = from; i < sel.from.line; ++i)
+ startch += lineSep.length + lines[i].text.length;
+ for (var i = from; i < sel.to.line; ++i)
+ endch += lineSep.length + lines[i].text.length;
+ editing = {text: text, from: from, to: to, start: startch, end: endch};
+ setSelRange(input, startch, reducedSelection ? startch : endch);
+ }
+ function focusInput() {
+ if (options.readOnly != "nocursor") input.focus();
+ }
+
+ function scrollCursorIntoView() {
+ var cursor = localCoords(sel.inverted ? sel.from : sel.to);
+ return scrollIntoView(cursor.x, cursor.y, cursor.x, cursor.yBot);
+ }
+ function scrollIntoView(x1, y1, x2, y2) {
+ var pl = paddingLeft(), pt = paddingTop(), lh = lineHeight();
+ y1 += pt; y2 += pt; x1 += pl; x2 += pl;
+ var screen = scroller.clientHeight, screentop = scroller.scrollTop, scrolled = false, result = true;
+ if (y1 < screentop) {scroller.scrollTop = Math.max(0, y1 - 2*lh); scrolled = true;}
+ else if (y2 > screentop + screen) {scroller.scrollTop = y2 + lh - screen; scrolled = true;}
+
+ var screenw = scroller.clientWidth, screenleft = scroller.scrollLeft;
+ if (x1 < screenleft) {
+ if (x1 < 50) x1 = 0;
+ scroller.scrollLeft = Math.max(0, x1 - 10);
+ scrolled = true;
+ }
+ else if (x2 > screenw + screenleft) {
+ scroller.scrollLeft = x2 + 10 - screenw;
+ scrolled = true;
+ if (x2 > code.clientWidth) result = false;
+ }
+ if (scrolled && options.onScroll) options.onScroll(instance);
+ return result;
+ }
+
+ function visibleLines() {
+ var lh = lineHeight(), top = scroller.scrollTop - paddingTop();
+ return {from: Math.min(lines.length, Math.max(0, Math.floor(top / lh))),
+ to: Math.min(lines.length, Math.ceil((top + scroller.clientHeight) / lh))};
+ }
+ // Uses a set of changes plus the current scroll position to
+ // determine which DOM updates have to be made, and makes the
+ // updates.
+ function updateDisplay(changes) {
+ if (!scroller.clientWidth) {
+ showingFrom = showingTo = 0;
+ return;
+ }
+ // First create a range of theoretically intact lines, and punch
+ // holes in that using the change info.
+ var intact = changes === true ? [] : [{from: showingFrom, to: showingTo, domStart: 0}];
+ for (var i = 0, l = changes.length || 0; i < l; ++i) {
+ var change = changes[i], intact2 = [], diff = change.diff || 0;
+ for (var j = 0, l2 = intact.length; j < l2; ++j) {
+ var range = intact[j];
+ if (change.to <= range.from)
+ intact2.push({from: range.from + diff, to: range.to + diff, domStart: range.domStart});
+ else if (range.to <= change.from)
+ intact2.push(range);
+ else {
+ if (change.from > range.from)
+ intact2.push({from: range.from, to: change.from, domStart: range.domStart})
+ if (change.to < range.to)
+ intact2.push({from: change.to + diff, to: range.to + diff,
+ domStart: range.domStart + (change.to - range.from)});
+ }
+ }
+ intact = intact2;
+ }
+
+ // Then, determine which lines we'd want to see, and which
+ // updates have to be made to get there.
+ var visible = visibleLines();
+ var from = Math.min(showingFrom, Math.max(visible.from - 3, 0)),
+ to = Math.min(lines.length, Math.max(showingTo, visible.to + 3)),
+ updates = [], domPos = 0, domEnd = showingTo - showingFrom, pos = from, changedLines = 0;
+
+ for (var i = 0, l = intact.length; i < l; ++i) {
+ var range = intact[i];
+ if (range.to <= from) continue;
+ if (range.from >= to) break;
+ if (range.domStart > domPos || range.from > pos) {
+ updates.push({from: pos, to: range.from, domSize: range.domStart - domPos, domStart: domPos});
+ changedLines += range.from - pos;
+ }
+ pos = range.to;
+ domPos = range.domStart + (range.to - range.from);
+ }
+ if (domPos != domEnd || pos != to) {
+ changedLines += Math.abs(to - pos);
+ updates.push({from: pos, to: to, domSize: domEnd - domPos, domStart: domPos});
+ }
+
+ if (!updates.length) return;
+ lineDiv.style.display = "none";
+ // If more than 30% of the screen needs update, just do a full
+ // redraw (which is quicker than patching)
+ if (changedLines > (visible.to - visible.from) * .3)
+ refreshDisplay(from = Math.max(visible.from - 10, 0), to = Math.min(visible.to + 7, lines.length));
+ // Otherwise, only update the stuff that needs updating.
+ else
+ patchDisplay(updates);
+ lineDiv.style.display = "";
+
+ // Position the mover div to align with the lines it's supposed
+ // to be showing (which will cover the visible display)
+ var different = from != showingFrom || to != showingTo || lastHeight != scroller.clientHeight;
+ showingFrom = from; showingTo = to;
+ mover.style.top = (from * lineHeight()) + "px";
+ if (different) {
+ lastHeight = scroller.clientHeight;
+ code.style.height = (lines.length * lineHeight() + 2 * paddingTop()) + "px";
+ updateGutter();
+ }
+
+ if (maxWidth == null) maxWidth = stringWidth(maxLine);
+ if (maxWidth > scroller.clientWidth) {
+ lineSpace.style.width = maxWidth + "px";
+ // Needed to prevent odd wrapping/hiding of widgets placed in here.
+ code.style.width = "";
+ code.style.width = scroller.scrollWidth + "px";
+ } else {
+ lineSpace.style.width = code.style.width = "";
+ }
+
+ // Since this is all rather error prone, it is honoured with the
+ // only assertion in the whole file.
+ if (lineDiv.childNodes.length != showingTo - showingFrom)
+ throw new Error("BAD PATCH! " + JSON.stringify(updates) + " size=" + (showingTo - showingFrom) +
+ " nodes=" + lineDiv.childNodes.length);
+ updateCursor();
+ }
+
+ function refreshDisplay(from, to) {
+ var html = [], start = {line: from, ch: 0}, inSel = posLess(sel.from, start) && !posLess(sel.to, start);
+ for (var i = from; i < to; ++i) {
+ var ch1 = null, ch2 = null;
+ if (inSel) {
+ ch1 = 0;
+ if (sel.to.line == i) {inSel = false; ch2 = sel.to.ch;}
+ }
+ else if (sel.from.line == i) {
+ if (sel.to.line == i) {ch1 = sel.from.ch; ch2 = sel.to.ch;}
+ else {inSel = true; ch1 = sel.from.ch;}
+ }
+ html.push(lines[i].getHTML(ch1, ch2, true));
+ }
+ lineDiv.innerHTML = html.join("");
+ }
+ function patchDisplay(updates) {
+ // Slightly different algorithm for IE (badInnerHTML), since
+ // there .innerHTML on PRE nodes is dumb, and discards
+ // whitespace.
+ var sfrom = sel.from.line, sto = sel.to.line, off = 0,
+ scratch = badInnerHTML && targetDocument.createElement("div");
+ for (var i = 0, e = updates.length; i < e; ++i) {
+ var rec = updates[i];
+ var extra = (rec.to - rec.from) - rec.domSize;
+ var nodeAfter = lineDiv.childNodes[rec.domStart + rec.domSize + off] || null;
+ if (badInnerHTML)
+ for (var j = Math.max(-extra, rec.domSize); j > 0; --j)
+ lineDiv.removeChild(nodeAfter ? nodeAfter.previousSibling : lineDiv.lastChild);
+ else if (extra) {
+ for (var j = Math.max(0, extra); j > 0; --j)
+ lineDiv.insertBefore(targetDocument.createElement("pre"), nodeAfter);
+ for (var j = Math.max(0, -extra); j > 0; --j)
+ lineDiv.removeChild(nodeAfter ? nodeAfter.previousSibling : lineDiv.lastChild);
+ }
+ var node = lineDiv.childNodes[rec.domStart + off], inSel = sfrom < rec.from && sto >= rec.from;
+ for (var j = rec.from; j < rec.to; ++j) {
+ var ch1 = null, ch2 = null;
+ if (inSel) {
+ ch1 = 0;
+ if (sto == j) {inSel = false; ch2 = sel.to.ch;}
+ }
+ else if (sfrom == j) {
+ if (sto == j) {ch1 = sel.from.ch; ch2 = sel.to.ch;}
+ else {inSel = true; ch1 = sel.from.ch;}
+ }
+ if (badInnerHTML) {
+ scratch.innerHTML = lines[j].getHTML(ch1, ch2, true);
+ lineDiv.insertBefore(scratch.firstChild, nodeAfter);
+ }
+ else {
+ node.innerHTML = lines[j].getHTML(ch1, ch2, false);
+ node.className = lines[j].className || "";
+ node = node.nextSibling;
+ }
+ }
+ off += extra;
+ }
+ }
+
+ function updateGutter() {
+ if (!options.gutter && !options.lineNumbers) return;
+ var hText = mover.offsetHeight, hEditor = scroller.clientHeight;
+ gutter.style.height = (hText - hEditor < 2 ? hEditor : hText) + "px";
+ var html = [];
+ for (var i = showingFrom; i < Math.max(showingTo, showingFrom + 1); ++i) {
+ var marker = lines[i].gutterMarker;
+ var text = options.lineNumbers ? i + options.firstLineNumber : null;
+ if (marker && marker.text)
+ text = marker.text.replace("%N%", text != null ? text : "");
+ else if (text == null)
+ text = "\u00a0";
+ html.push((marker && marker.style ? '
' : "
"), text, "
");
+ }
+ gutter.style.display = "none";
+ gutterText.innerHTML = html.join("");
+ var minwidth = String(lines.length).length, firstNode = gutterText.firstChild, val = eltText(firstNode), pad = "";
+ while (val.length + pad.length < minwidth) pad += "\u00a0";
+ if (pad) firstNode.insertBefore(targetDocument.createTextNode(pad), firstNode.firstChild);
+ gutter.style.display = "";
+ lineSpace.style.marginLeft = gutter.offsetWidth + "px";
+ }
+ function updateCursor() {
+ var head = sel.inverted ? sel.from : sel.to, lh = lineHeight();
+ var x = charX(head.line, head.ch) + "px", y = (head.line - showingFrom) * lh + "px";
+ inputDiv.style.top = (head.line * lh - scroller.scrollTop) + "px";
+ if (posEq(sel.from, sel.to)) {
+ cursor.style.top = y; cursor.style.left = x;
+ cursor.style.display = "";
+ }
+ else cursor.style.display = "none";
+ }
+
+ function setSelectionUser(from, to) {
+ var sh = shiftSelecting && clipPos(shiftSelecting);
+ if (sh) {
+ if (posLess(sh, from)) from = sh;
+ else if (posLess(to, sh)) to = sh;
+ }
+ setSelection(from, to);
+ }
+ // Update the selection. Last two args are only used by
+ // updateLines, since they have to be expressed in the line
+ // numbers before the update.
+ function setSelection(from, to, oldFrom, oldTo) {
+ if (posEq(sel.from, from) && posEq(sel.to, to)) return;
+ if (posLess(to, from)) {var tmp = to; to = from; from = tmp;}
+
+ if (posEq(from, to)) sel.inverted = false;
+ else if (posEq(from, sel.to)) sel.inverted = false;
+ else if (posEq(to, sel.from)) sel.inverted = true;
+
+ // Some ugly logic used to only mark the lines that actually did
+ // see a change in selection as changed, rather than the whole
+ // selected range.
+ if (oldFrom == null) {oldFrom = sel.from.line; oldTo = sel.to.line;}
+ if (posEq(from, to)) {
+ if (!posEq(sel.from, sel.to))
+ changes.push({from: oldFrom, to: oldTo + 1});
+ }
+ else if (posEq(sel.from, sel.to)) {
+ changes.push({from: from.line, to: to.line + 1});
+ }
+ else {
+ if (!posEq(from, sel.from)) {
+ if (from.line < oldFrom)
+ changes.push({from: from.line, to: Math.min(to.line, oldFrom) + 1});
+ else
+ changes.push({from: oldFrom, to: Math.min(oldTo, from.line) + 1});
+ }
+ if (!posEq(to, sel.to)) {
+ if (to.line < oldTo)
+ changes.push({from: Math.max(oldFrom, from.line), to: oldTo + 1});
+ else
+ changes.push({from: Math.max(from.line, oldTo), to: to.line + 1});
+ }
+ }
+ sel.from = from; sel.to = to;
+ selectionChanged = true;
+ }
+ function setCursor(line, ch, user) {
+ var pos = clipPos({line: line, ch: ch || 0});
+ (user ? setSelectionUser : setSelection)(pos, pos);
+ }
+
+ function clipLine(n) {return Math.max(0, Math.min(n, lines.length-1));}
+ function clipPos(pos) {
+ if (pos.line < 0) return {line: 0, ch: 0};
+ if (pos.line >= lines.length) return {line: lines.length-1, ch: lines[lines.length-1].text.length};
+ var ch = pos.ch, linelen = lines[pos.line].text.length;
+ if (ch == null || ch > linelen) return {line: pos.line, ch: linelen};
+ else if (ch < 0) return {line: pos.line, ch: 0};
+ else return pos;
+ }
+
+ function scrollPage(down) {
+ var linesPerPage = Math.floor(scroller.clientHeight / lineHeight()), head = sel.inverted ? sel.from : sel.to;
+ setCursor(head.line + (Math.max(linesPerPage - 1, 1) * (down ? 1 : -1)), head.ch, true);
+ }
+ function scrollEnd(top) {
+ var pos = top ? {line: 0, ch: 0} : {line: lines.length - 1, ch: lines[lines.length-1].text.length};
+ setSelectionUser(pos, pos);
+ }
+ function selectAll() {
+ var endLine = lines.length - 1;
+ setSelection({line: 0, ch: 0}, {line: endLine, ch: lines[endLine].text.length});
+ }
+ function selectWordAt(pos) {
+ var line = lines[pos.line].text;
+ var start = pos.ch, end = pos.ch;
+ while (start > 0 && /\w/.test(line.charAt(start - 1))) --start;
+ while (end < line.length && /\w/.test(line.charAt(end))) ++end;
+ setSelectionUser({line: pos.line, ch: start}, {line: pos.line, ch: end});
+ }
+ function selectLine(line) {
+ setSelectionUser({line: line, ch: 0}, {line: line, ch: lines[line].text.length});
+ }
+ function handleEnter() {
+ replaceSelection("\n", "end");
+ if (options.enterMode != "flat")
+ indentLine(sel.from.line, options.enterMode == "keep" ? "prev" : "smart");
+ }
+ function handleTab(shift) {
+ function indentSelected(mode) {
+ if (posEq(sel.from, sel.to)) return indentLine(sel.from.line, mode);
+ var e = sel.to.line - (sel.to.ch ? 0 : 1);
+ for (var i = sel.from.line; i <= e; ++i) indentLine(i, mode);
+ }
+ shiftSelecting = null;
+ switch (options.tabMode) {
+ case "default":
+ return false;
+ case "indent":
+ indentSelected("smart");
+ break;
+ case "classic":
+ if (posEq(sel.from, sel.to)) {
+ if (shift) indentLine(sel.from.line, "smart");
+ else replaceSelection("\t", "end");
+ break;
+ }
+ case "shift":
+ indentSelected(shift ? "subtract" : "add");
+ break;
+ }
+ return true;
+ }
+
+ function indentLine(n, how) {
+ if (how == "smart") {
+ if (!mode.indent) how = "prev";
+ else var state = getStateBefore(n);
+ }
+
+ var line = lines[n], curSpace = line.indentation(), curSpaceString = line.text.match(/^\s*/)[0], indentation;
+ if (how == "prev") {
+ if (n) indentation = lines[n-1].indentation();
+ else indentation = 0;
+ }
+ else if (how == "smart") indentation = mode.indent(state, line.text.slice(curSpaceString.length));
+ else if (how == "add") indentation = curSpace + options.indentUnit;
+ else if (how == "subtract") indentation = curSpace - options.indentUnit;
+ indentation = Math.max(0, indentation);
+ var diff = indentation - curSpace;
+
+ if (!diff) {
+ if (sel.from.line != n && sel.to.line != n) return;
+ var indentString = curSpaceString;
+ }
+ else {
+ var indentString = "", pos = 0;
+ if (options.indentWithTabs)
+ for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t";}
+ while (pos < indentation) {++pos; indentString += " ";}
+ }
+
+ replaceRange(indentString, {line: n, ch: 0}, {line: n, ch: curSpaceString.length});
+ }
+
+ function loadMode() {
+ mode = CodeMirror.getMode(options, options.mode);
+ for (var i = 0, l = lines.length; i < l; ++i)
+ lines[i].stateAfter = null;
+ work = [0];
+ startWorker();
+ }
+ function gutterChanged() {
+ var visible = options.gutter || options.lineNumbers;
+ gutter.style.display = visible ? "" : "none";
+ if (visible) updateGutter();
+ else lineDiv.parentNode.style.marginLeft = 0;
+ }
+
+ function markText(from, to, className) {
+ from = clipPos(from); to = clipPos(to);
+ var accum = [];
+ function add(line, from, to, className) {
+ var line = lines[line], mark = line.addMark(from, to, className);
+ mark.line = line;
+ accum.push(mark);
+ }
+ if (from.line == to.line) add(from.line, from.ch, to.ch, className);
+ else {
+ add(from.line, from.ch, null, className);
+ for (var i = from.line + 1, e = to.line; i < e; ++i)
+ add(i, 0, null, className);
+ add(to.line, 0, to.ch, className);
+ }
+ changes.push({from: from.line, to: to.line + 1});
+ return function() {
+ var start, end;
+ for (var i = 0; i < accum.length; ++i) {
+ var mark = accum[i], found = indexOf(lines, mark.line);
+ mark.line.removeMark(mark);
+ if (found > -1) {
+ if (start == null) start = found;
+ end = found;
+ }
+ }
+ if (start != null) changes.push({from: start, to: end + 1});
+ };
+ }
+
+ function addGutterMarker(line, text, className) {
+ if (typeof line == "number") line = lines[clipLine(line)];
+ line.gutterMarker = {text: text, style: className};
+ updateGutter();
+ return line;
+ }
+ function removeGutterMarker(line) {
+ if (typeof line == "number") line = lines[clipLine(line)];
+ line.gutterMarker = null;
+ updateGutter();
+ }
+ function setLineClass(line, className) {
+ if (typeof line == "number") {
+ var no = line;
+ line = lines[clipLine(line)];
+ }
+ else {
+ var no = indexOf(lines, line);
+ if (no == -1) return null;
+ }
+ if (line.className != className) {
+ line.className = className;
+ changes.push({from: no, to: no + 1});
+ }
+ return line;
+ }
+
+ function lineInfo(line) {
+ if (typeof line == "number") {
+ var n = line;
+ line = lines[line];
+ if (!line) return null;
+ }
+ else {
+ var n = indexOf(lines, line);
+ if (n == -1) return null;
+ }
+ var marker = line.gutterMarker;
+ return {line: n, text: line.text, markerText: marker && marker.text, markerClass: marker && marker.style};
+ }
+
+ function stringWidth(str) {
+ measure.innerHTML = "
x
";
+ measure.firstChild.firstChild.firstChild.nodeValue = str;
+ return measure.firstChild.firstChild.offsetWidth || 10;
+ }
+ // These are used to go from pixel positions to character
+ // positions, taking varying character widths into account.
+ function charX(line, pos) {
+ if (pos == 0) return 0;
+ measure.innerHTML = "
CodeMirror is a code-editor component that can be embedded in
+ Web pages. It provides only the editor component, no
+ accompanying buttons
+ (see CodeMirror
+ UI for a drop-in button bar), auto-completion, or other IDE
+ functionality. It does provide a rich API on top of which such
+ functionality can be straightforwardly implemented.
+
+
CodeMirror works with language-specific modes. Modes are
+ JavaScript programs that help color (and optionally indent) text
+ written in a given language. The distribution comes with a few
+ modes (see the mode/ directory), and it isn't hard
+ to write new ones for other languages.
+
+
Basic Usage
+
+
The easiest way to use CodeMirror is to simply load the script
+ and style sheet found under lib/ in the distribution,
+ plus the script and style sheet for the mode(s) you want to use.
+ (See also the compresion helper.) For
+ example:
Having done this, an editor instance can be created like
+ this:
+
+
var myCodeMirror = CodeMirror(document.body);
+
+
The editor will be appended to the document body, will start
+ empty, and will use the mode that we loaded. To have more control
+ over the new editor, a configuration object can be passed
+ to CodeMirror as a second argument:
This will initialize the editor with a piece of code already in
+ it, and explicitly tell it to use the JavaScript mode (which is
+ useful when multiple modes are loaded).
+ See below for a full discussion of the
+ configuration options that CodeMirror accepts.
+
+
In cases where you don't want to append the editor to an
+ element, and need more control over the way it is inserted, the
+ first argument to the CodeMirror function can also
+ be a function that, when given a DOM element, inserts it into the
+ document somewhere. This could be used to, for example, replace a
+ textarea with a real editor:
However, for this use case, which is a common way to use
+ CodeMirror, the library provides a much more powerful
+ shortcut:
+
+
var myCodeMirror = CodeMirror.fromTextArea(myTextArea);
+
+
This will, among other things, ensure that the textarea's value
+ is updated when the form (if it is part of a form) is submitted.
+ See the API reference for a full
+ description of this method.
+
+
Configuration
+
+
Both the CodeMirror function and
+ its fromTextArea method take as second (optional)
+ argument an object containing configuration options. Any option
+ not supplied like this will be taken
+ from CodeMirror.defaults, an object containing the
+ default options. You can update this object to change the defaults
+ on your page.
+
+
Options are not checked in any way, so setting bogus option
+ values is bound to lead to odd errors.
+
+
Note: CodeMirror
+ 2 does not support
+ line-wrapping. I would have very much liked to support it, but it
+ combines extremely poorly with the way the editor is
+ implemented.
+
+
These are the supported options:
+
+
+
value (string)
+
The starting value of the editor.
+
+
mode (string or object)
+
The mode to use. When not given, this will default to the
+ first mode that was loaded. It may be a string, which either
+ simply names the mode or is
+ a MIME type
+ associated with the mode. Alternatively, it may be an object
+ containing configuration options for the mode, with
+ a name property that names the mode (for
+ example {name: "javascript", json: true}). The demo
+ pages for each mode contain information about what configuration
+ parameters the mode supports. You can ask CodeMirror which modes
+ and MIME types are loaded with
+ the CodeMirror.listModes
+ and CodeMirror.listMIMEs functions.
+
+
indentUnit (integer)
+
How many spaces a block (whatever that means in the edited
+ language) should be indented. The default is 2.
+
+
indentWithTabs (boolean)
+
Whether, when indenting, the first N*8 spaces should be
+ replaced by N tabs. Default is false.
+
+
tabMode (string)
+
Determines what happens when the user presses the tab key.
+ Must be one of the following:
+
+
"classic" (the default)
+
When nothing is selected, insert a tab. Otherwise,
+ behave like the "shift" mode. (When shift is
+ held, this behaves like the "indent" mode.)
+
"shift"
+
Indent all selected lines by
+ one indentUnit.
+ If shift was held while pressing tab, un-indent all selected
+ lines one unit.
+
"indent"
+
Indent the line the 'correctly', based on its syntactic
+ context. Only works if the
+ mode supports it.
+
"default"
+
Do not capture tab presses, let the browser apply its
+ default behaviour (which usually means it skips to the next
+ control).
+
+
+
enterMode (string)
+
Determines whether and how new lines are indented when the
+ enter key is pressed. The following modes are supported:
+
+
"indent" (the default)
+
Use the mode's indentation rules to give the new line
+ the correct indentation.
+
"keep"
+
Indent the line the same as the previous line.
+
"flat"
+
Do not indent the new line.
+
+
+
electricChars (boolean)
+
Configures whether the editor should re-indent the current
+ line when a character is typed that might change its proper
+ indentation (only works if the mode supports indentation).
+ Default is true.
+
+
lineNumbers (boolean)
+
Whether to show line numbers to the left of the editor.
+
+
firstLineNumber (integer)
+
At which number to start counting lines. Default is 1.
+
+
gutter (boolean)
+
Can be used to force a 'gutter' (empty space on the left of
+ the editor) to be shown even when no line numbers are active.
+ This is useful for setting markers.
+
+
readOnly (boolean)
+
This disables editing of the editor content by the user.
+ (Changes through API functions will still be possible.)
+
+
onChange (function)
+
When given, this function will be called every time the
+ content of the editor is changed. It will be given the editor
+ instance as only argument.
+
+
onCursorActivity (function)
+
Like onChange, but will also be called when the
+ cursor moves without any changes being made.
+
+
onGutterClick (function)
+
When given, will be called whenever the editor gutter (the
+ line-number area) is clicked. Will be given the editor instance
+ as first argument, and the (zero-based) number of the line that
+ was clicked as second argument.
+
+
onFocus, onBlur (function)
+
The given functions will be called whenever the editor is
+ focused or unfocused.
+
+
onScroll (function)
+
When given, will be called whenever the editor is
+ scrolled.
+
+
matchBrackets (boolean)
+
Determines whether brackets are matched whenever the cursor
+ is moved next to a bracket.
+
+
workTime, workDelay (number)
+
Highlighting is done by a pseudo background-thread that will
+ work for workTime milliseconds, and then use
+ timeout to sleep for workDelay milliseconds. The
+ defaults are 200 and 300, you can change these options to make
+ the highlighting more or less aggressive.
+
+
undoDepth (integer)
+
The maximum number of undo levels that the editor stores.
+ Defaults to 40.
+
+
tabindex (integer)
+
The tab
+ index to assign to the editor. If not given, no tab index
+ will be assigned.
+
+
onKeyEvent (function)
+
This provides a rather low-level hook into CodeMirror's key
+ handling. If provided, this function will be called on
+ every keydown and keypress event that
+ CodeMirror captures. It will be passed two arguments, the editor
+ instance and the key event. This key event is pretty much the
+ raw key event, except that a stop() method is
+ always added to it. You could feed it to, for
+ example, jQuery.Event to further normalize
+ it. This function can inspect the key event, and handle it if
+ it wants to. It may return true to tell CodeMirror to ignore the
+ event. Be wary that, on some browsers, stopping
+ a keydown does not stop the keypress
+ from firing, whereas on others it does. If you respond to an
+ event, you should probably inspect its type
+ property and only do something when it is keydown
+ (or keypress for actions that need character
+ data).
+
+
+
Customized Styling
+
+
Up to a certain extent, CodeMirror's look can be changed by
+ modifying style sheet files. The style sheets supplied by modes
+ simply provide the colors for that mode, and can be adapted in a
+ very straightforward way. To style the editor itself, it is
+ possible to alter or override the styles defined
+ in codemirror.css.
+
+
Some care must be taken there, since a lot of the rules in this
+ file are necessary to have CodeMirror function properly. Adjusting
+ colors should be safe, of course, and with some care a lot of
+ other things can be changed as well. The CSS classes defined in
+ this file serve the following roles:
+
+
+
CodeMirror
+
The outer element of the editor. This determines whether the
+ editor scrolls (overflow: auto + fixed height). Can
+ also be used to set styles that should hold for everything
+ inside the editor, or to set a background.
+
+
CodeMirror-focused
+
Whenever the editor is focused, the top element gets this
+ class. This is used to hide the cursor and give the selection a
+ different color when the editor is not focused.
+
+
CodeMirror-gutter
+
Use this for giving a background or a border to the editor
+ gutter. Don't set any padding here,
+ use CodeMirror-gutter-text for that. By default,
+ the gutter is 'fluid', meaning it will adjust its width to the
+ maximum line number or line marker width. You can also set a
+ fixed width if you want.
+
+
CodeMirror-gutter-text
+
Used to style the actual line numbers. For the numbers to
+ line up, you'll want this style to use exactly the same font and
+ vertical padding as normal edited text, as per
+ the CodeMirror-lines class.
+
+
CodeMirror-lines
+
The visible lines. If this has vertical
+ padding, CodeMirror-gutter should have the same
+ padding.
+
+
CodeMirror-cursor
+
The cursor is a block element that is absolutely positioned.
+ You can make it look whichever way you want.
+
+
CodeMirror-selected
+
The selection is represented by span elements
+ with this class.
These are used to style matched (or unmatched) brackets.
+
+
+
The actual lines, as well as the cursor, are represented
+ by pre elements. By default no text styling (such as
+ bold) that might change line height is applied. If you do want
+ such effects, you'll have to give CodeMirror pre a
+ fixed height. Also, you must still take care that character width
+ is constant.
+
+
If your page's style sheets do funky things to
+ all div or pre elements (you probably
+ shouldn't do that), you'll have to define rules to cancel these
+ effects out again for elements under the CodeMirror
+ class.
+
+
Programming API
+
+
A lot of CodeMirror features are only available through its API.
+ This has the disadvantage that you need to do work to enable them,
+ and the advantage that CodeMirror will fit seamlessly into your
+ application.
+
+
Whenever points in the document are represented, the API uses
+ objects with line and ch properties.
+ Both are zero-based. CodeMirror makes sure to 'clip' any positions
+ passed by client code so that they fit inside the document, so you
+ shouldn't worry too much about sanitizing your coordinates. If you
+ give ch a value of null, or don't
+ specify it, it will be replaced with the length of the specified
+ line.
+
+
+
getValue() → string
+
Get the current editor content.
+
setValue(string)
+
Set the editor content.
+
+
getSelection() → string
+
Get the currently selected code.
+
replaceSelection(string)
+
Replace the selection with the given string.
+
+
focus()
+
Give the editor focus.
+
+
setOption(option, value)
+
Change the configuration of the editor. option
+ should the name of an option,
+ and value should be a valid value for that
+ option.
+
getOption(option) → value
+
Retrieves the current value of the given option for this
+ editor instance.
+
+
cursorCoords(start) → object
+
Returns an {x, y, yBot} object containing the
+ coordinates of the cursor relative to the top-left corner of the
+ page. yBot is the coordinate of the bottom of the
+ cursor. start is a boolean indicating whether you
+ want the start or the end of the selection.
+
charCoords(pos) → object
+
Like cursorCoords, but returns the position of
+ an arbitrary characters. pos should be
+ a {line, ch} object.
+
coordsChar(object) → pos
+
Given an {x, y} object (in page coordinates),
+ returns the {line, ch} position that corresponds to
+ it.
+
+
undo()
+
Undo one edit (if any undo events are stored).
+
redo()
+
Redo one undone edit.
+
historySize() → object
+
Returns an object with {undo, redo} properties,
+ both of which hold integers, indicating the amount of stored
+ undo and redo operations.
+
+
indentLine(line)
+
Reset the given line's indentation to the indentation
+ prescribed by the mode.
+
+
getSearchCursor(query, start, caseFold) → cursor
+
Used to implement search/replace
+ functionality. query can be a regular expression or
+ a string (only strings will match across lines—if they contain
+ newlines). start provides the starting position of
+ the search. It can be a {line, ch} object, or can
+ be left off to default to the start of the
+ document. caseFold is only relevant when matching a
+ string. It will cause the search to be case-insensitive. A
+ search cursor has the following methods:
+
+
findNext(), findPrevious() → boolean
+
Search forward or backward from the current position.
+ The return value indicates whether a match was found. If
+ matching a regular expression, the return value will be the
+ array returned by the match method, in case you
+ want to extract matched groups.
+
from(), to() → object
+
These are only valid when the last call
+ to findNext or findPrevious did
+ not return false. They will return {line, ch}
+ objects pointing at the start and end of the match.
+
+
+
getTokenAt(pos) → object
+
Retrieves information about the token the current mode found
+ at the given position (a {line, ch} object). The
+ returned object has the following properties:
+
+
start
The character (on the given line) at which the token starts.
+
end
The character at which the token ends.
+
string
The token's string.
+
className
The class the mode assigned
+ to the token. (Can be null when no class was assigned.)
+
+
+
markText(from, to, className) → function
+
Can be used to mark a range of text with a specific CSS
+ class name. from and to should
+ be {line, ch} objects. The method will return a
+ function that can be called to remove the marking.
+
+
setMarker(line, text, className) → lineHandle
+
Add a gutter marker for the given line. Gutter markers are
+ shown in the line-number area (instead of the number for this
+ line). Both text and className are
+ optional. Setting text to a Unicode character like
+ ● tends to give a nice effect. To put a picture in the gutter,
+ set text to a space and className to
+ something that sets a background image. If you
+ specify text, the given text (which may contain
+ HTML) will, by default, replace the line number for that line.
+ If this is not what you want, you can include the
+ string %N% in the text, which will be replaced by
+ the line number.
+
clearMarker(line)
+
Clears a marker created
+ with setMarker. line can be either a
+ number or a handle returned by setMarker (since a
+ number may now refer to a different line if something was added
+ or deleted).
+
setLineClass(line, className) → lineHandle
+
Set a CSS class name for the given line. line
+ can be a number or a line handle (as returned
+ by setMarker or this function).
+ Pass null to clear the class for a line.
+
+
lineInfo(line) → object
+
Returns the line number, text content, and marker status of
+ the given line, which can be either a number or a handle
+ returned by setMarker. The returned object has the
+ structure {line, text, markerText, markerClass}.
+
+
addWidget(pos, node, scrollIntoView)
+
Puts node, which should be an absolutely
+ positioned DOM node, into the editor, positioned right below the
+ given {line, ch} position.
+ When scrollIntoView is true, the editor will ensure
+ that the entire node is visible (if possible). To remove the
+ widget again, simply use DOM methods (move it somewhere else, or
+ call removeChild on its parent).
+
+
matchBrackets()
+
Force matching-bracket-highlighting to happen.
+
+
lineCount() → number
+
Get the number of lines in the editor.
+
+
getCursor(start) → object
+
start is a boolean indicating whether the start
+ or the end of the selection must be retrieved. If it is not
+ given, the current cursor pos, i.e. the side of the selection
+ that would move if you pressed an arrow key, is chosen.
+ A {line, ch} object will be returned.
+
somethingSelected() → boolean
+
Return true if any text is selected.
+
setCursor(pos)
+
Set the cursor position. You can either pass a
+ single {line, ch} object, or the line and the
+ character as two separate parameters.
+
setSelection(start, end)
+
Set the selection range. start
+ and end should be {line, ch} objects.
+
+
getLine(n) → string
+
Get the content of line n.
+
setLine(n, text)
+
Set the content of line n.
+
removeLine(n)
+
Remove the given line from the document.
+
+
getRange(from, to) → string
+
Get the text between the given points in the editor, which
+ should be {line, ch} objects.
+
replaceRange(string, from, to)
+
Replace the part of the document between from
+ and to with the given string. from
+ and to must be {line, ch}
+ objects. to can be left off to simply insert the
+ string at position from.
+
+
+
The following are more low-level methods:
+
+
+
operation(func) → result
+
CodeMirror internally buffers changes and only updates its
+ DOM structure after it has finished performing some operation.
+ If you need to perform a lot of operations on a CodeMirror
+ instance, you can call this method with a function argument. It
+ will call the function, buffering up all changes, and only doing
+ the expensive update after the function returns. This can be a
+ lot faster. The return value from this method will be the return
+ value of your function.
+
+
refresh()
+
If your code does something to change the size of the editor
+ element (window resizes are already listened for), or unhides
+ it, you should probably follow up by calling this method to
+ ensure CodeMirror is still looking as intended.
+
+
getInputField() → textarea
+
Returns the hiden textarea used to read input.
+
getWrapperElement() → node
+
Returns the DOM node that represents the editor. Remove this
+ from your tree to delete an editor instance.
+
+
+
Finally, the CodeMirror object
+ itself has a method fromTextArea. This takes a
+ textarea DOM node as first argument and an optional configuration
+ object as second. It will replace the textarea with a CodeMirror
+ instance, and wire up the form of that textarea (if any) to make
+ sure the editor contents are put into the textarea when the form
+ is submitted. A CodeMirror instance created this way has two
+ additional methods:
+
+
+
save()
+
Copy the content of the editor into the textarea.
+
+
toTextArea()
+
Remove the editor, and restore the original textarea (with
+ the editor's current content).
+
+
+
Writing CodeMirror Modes
+
+
Modes typically consist of a JavaScript file and a CSS file.
+ The CSS file (see, for
+ example javascript.css)
+ defines the classes that will be used to style the syntactic
+ elements of the code, and the script contains the logic to
+ actually assign these classes to the right pieces of text.
+
+
You'll usually want to use some kind of prefix for your CSS
+ classes, so that they are unlikely to clash with other classes,
+ both those used by other modes and those defined by the page in
+ which CodeMirror is embedded.
+
+
The mode script should
+ call CodeMirror.defineMode to register itself with
+ CodeMirror. This function takes two arguments. The first should be
+ the name of the mode, for which you should use a lowercase string,
+ preferably one that is also the name of the files that define the
+ mode (i.e. "xml" is defined xml.js). The
+ second argument should be a function that, given a CodeMirror
+ configuration object (the thing passed to
+ the CodeMirror function) and a mode configuration
+ object (as in the mode
+ option), returns a mode object.
+
+
Typically, you should use this second argument
+ to defineMode as your module scope function (modes
+ should not leak anything into the global scope!), i.e. write your
+ whole mode inside this function.
+
+
The main responsibility of a mode script is parsing
+ the content of the editor. Depending on the language and the
+ amount of functionality desired, this can be done in really easy
+ or extremely complicated ways. Some parsers can be stateless,
+ meaning that they look at one element (token) of the code
+ at a time, with no memory of what came before. Most, however, will
+ need to remember something. This is done by using a state
+ object, which is an object that can be mutated every time a
+ new token is read.
+
+
Modes that use a state must define
+ a startState method on their mode object. This is a
+ function of no arguments that produces a state object to be used
+ at the start of a document.
+
+
The most important part of a mode object is
+ its token(stream, state) method. All modes must
+ define this method. It should read one token from the stream it is
+ given as an argument, optionally update its state, and return a
+ CSS class string, or null for tokens that do not have
+ to be styled.
+
+
The stream object encapsulates a line of code
+ (tokens may never span lines) and our current position in that
+ line. It has the following API:
+
+
+
eol() → boolean
+
Returns true only if the stream is at the end of the
+ line.
+
sol() → boolean
+
Returns true only if the stream is at the start of the
+ line.
+
+
peek() → character
+
Returns the next character in the stream without advancing
+ it. Will return undefined at the end of the
+ line.
+
next() → character
+
Returns the next character in the stream and advances it.
+ Also returns undefined when no more characters are
+ available.
+
+
eat(match) → character
+
match can be a character, a regular expression,
+ or a function that takes a character and returns a boolean. If
+ the next character in the stream 'matches' the given argument,
+ it is consumed and returned. Otherwise, undefined
+ is returned.
+
eatWhile(match) → boolean
+
Repeatedly calls eat with the given argument,
+ until it fails. Returns true if any characters were eaten.
+
eatSpace() → boolean
+
Shortcut for eatWhile when matching
+ white-space.
+
skipToEnd()
+
Moves the position to the end of the line.
+
skipTo(ch) → boolean
+
Skips to the next occurrence of the given character, if
+ found. Returns true if the character was found.
+
match(pattern, consume, caseFold) → boolean
+
Act like a
+ multi-character eat—if consume is true
+ or not given—or a look-ahead that doesn't update the stream
+ position—if it is false. pattern can be either a
+ string or a regular expression starting with ^.
+ When it is a string, caseFold can be set to true to
+ make the match case-insensitive. When successfully matching a
+ regular expression, the returned value will be the array
+ returned by match, in case you need to extract
+ matched groups.
+
+
backUp(n)
+
Backs up the stream n characters. Backing it up
+ further than the start of the current token will cause things to
+ break, so be careful.
+
column() → integer
+
Returns the column (taking into account tabs) at which the
+ current token starts. Can be used to find out whether a token
+ starts a new line.
+
indentation() → integer
+
Tells you how far the current line has been indented, in
+ spaces. Corrects for tab characters.
+
+
current() → string
+
Get the string between the start of the current token and
+ the current stream position.
+
+
+
Because state object are mutated, and CodeMirror
+ needs to keep valid versions of a state around so that it can
+ restart a parse at any line, copies must be made of state objects.
+ The default algorithm used is that a new state object is created,
+ which gets all the properties of the old object. Any properties
+ which hold arrays get a copy of these arrays (since arrays tend to
+ be used as mutable stacks). When this is not correct, for example
+ because a mode mutates non-array properties of its state object, a
+ mode object should define a copyState method,
+ which is given a state and should return a safe copy of that
+ state.
+
+
If you want your mode to provide smart indentation
+ (see entermode
+ and tabMode when they
+ have a value of "indent"), you must define
+ an indent(state, textAfter) method on your mode
+ object.
+
+
The indentation method should inspect the given state object,
+ and optionally the textAfter string, which contains
+ the text on the line that is being indented, and return an
+ integer, the amount of spaces to indent. It should usually take
+ the indentUnit
+ option into account.
+
+
Finally, a mode may define
+ an electricChars property, which should hold a string
+ containing all the characters that should trigger the behaviour
+ described for
+ the electricChars
+ option.
+
+
So, to summarize, a mode must provide
+ a token method, and it may
+ provide startState, copyState,
+ and indent methods. For an example of a trivial mode,
+ see the diff mode, for a more
+ involved example, see
+ the JavaScript
+ mode.
+
+
Sometimes, it is useful for modes to nest—to have one
+ mode delegate work to another mode. An example of this kind of
+ mode is the mixed-mode HTML
+ mode. To implement such nesting, it is usually necessary to
+ create mode objects and copy states yourself. To create a mode
+ object, there are CodeMirror.getMode(options,
+ parserConfig), where the first argument is a configuration
+ object as passed to the mode constructor function, and the second
+ argument is a mode specification as in
+ the mode option. To copy a
+ state object, call CodeMirror.copyState(mode, state),
+ where mode is the mode that created the given
+ state.
+
+
To make indentation work properly in a nested parser, it is
+ advisable to give the startState method of modes that
+ are intended to be nested an optional argument that provides the
+ base indentation for the block of code. The JavaScript and CSS
+ parser do this, for example, to allow JavaScript and CSS code
+ inside the mixed-mode HTML mode to be properly indented.
+
+
Finally, it is possible to associate your mode, or a certain
+ configuration of your mode, with
+ a MIME type. For
+ example, the JavaScript mode associates itself
+ with text/javascript, and its JSON variant
+ with application/json. To do this,
+ call CodeMirror.defineMIME(mime, modeSpec),
+ where modeSpec can be a string or object specifying a
+ mode, as in the mode
+ option.
Simple mode that tries to handle C-like languages as well as it
+ can. Takes two configuration parameters: keywords, an
+ object whose property names are the keywords in the language,
+ and useCPP, which determines whether C preprocessor
+ directives are recognized.