From www@source.lon-capa.org Mon Oct 4 15:01:04 2010
From: www@source.lon-capa.org (www)
Date: Mon, 04 Oct 2010 14:01:04 -0000
Subject: [LON-CAPA-cvs] cvs: modules /gerd/geogebra rawdraft.problem
Message-ID:
This is a MIME encoded message
--www1286200864
Content-Type: text/plain
www Mon Oct 4 14:01:04 2010 EDT
Added files:
/modules/gerd/geogebra rawdraft.problem
Log:
Raw HTML code for GeoGebra window and splines
--www1286200864
Content-Type: text/plain
Content-Disposition: attachment; filename="www-20101004140104.txt"
Index: modules/gerd/geogebra/rawdraft.problem
+++ modules/gerd/geogebra/rawdraft.problem
blah
Sorry, the GeoGebra Applet could not be started. Please make sure that Java 1.4.2 (or later) is installed and active in your browser (Click here to install Java now )
blah blah
--www1286200864--
From www@source.lon-capa.org Mon Oct 4 15:34:46 2010
From: www@source.lon-capa.org (www)
Date: Mon, 04 Oct 2010 14:34:46 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /homework chemresponse.pm functionplotresponse.pm /interface lonhtmlcommon.pm
Message-ID:
This is a MIME encoded message
--www1286202886
Content-Type: text/plain
www Mon Oct 4 14:34:46 2010 EDT
Modified files:
/loncom/homework chemresponse.pm functionplotresponse.pm
/loncom/interface lonhtmlcommon.pm
Log:
Common message if Java is not running.
Work-in-progress for GeoGebra
--www1286202886
Content-Type: text/plain
Content-Disposition: attachment; filename="www-20101004143446.txt"
Index: loncom/homework/chemresponse.pm
diff -u loncom/homework/chemresponse.pm:1.87 loncom/homework/chemresponse.pm:1.88
--- loncom/homework/chemresponse.pm:1.87 Sun Feb 28 23:35:53 2010
+++ loncom/homework/chemresponse.pm Mon Oct 4 14:34:43 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# chemical equation style response
#
-# $Id: chemresponse.pm,v 1.87 2010/02/28 23:35:53 raeburn Exp $
+# $Id: chemresponse.pm,v 1.88 2010/10/04 14:34:43 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -116,7 +116,7 @@
'bgcolor' => '#FFFFFF',});
my $end_page =
&Apache::loncommon::end_page({'js_ready' => 1,});
-
+ my $java_not_enabled=&Apache::lonhtmlcommon::java_not_enabled();
my $body=<
@@ -143,7 +143,7 @@
-You have to enable Java and JavaScript on your machine.
+$java_not_enabled
$molecule
Index: loncom/homework/functionplotresponse.pm
diff -u loncom/homework/functionplotresponse.pm:1.1 loncom/homework/functionplotresponse.pm:1.2
--- loncom/homework/functionplotresponse.pm:1.1 Mon Sep 27 22:15:32 2010
+++ loncom/homework/functionplotresponse.pm Mon Oct 4 14:34:43 2010
@@ -1,7 +1,7 @@
# LearningOnline Network with CAPA
# option list style responses
#
-# $Id: functionplotresponse.pm,v 1.1 2010/09/27 22:15:32 www Exp $
+# $Id: functionplotresponse.pm,v 1.2 2010/10/04 14:34:43 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -45,18 +45,49 @@
}
sub geogebra_endcode {
- return "\n\n";
+ return &Apache::lonhtmlcommon::java_not_enabled()."\n";
+}
+
+sub geogebra_spline_program {
+ return (<
+ENDSPLINEPROGRAM
+}
+
+sub geogebra_default_parameters {
+ return(<
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ENDDEFAULTPARAMETERS
}
sub start_functionplotresponse {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
my $result='';
- #when in a option response use these
-# &Apache::lonxml::register('Apache::optionresponse',('foilgroup','foil','conceptgroup','drawoptionlist'));
- push (@Apache::lonxml::namespace,'optionresponse');
my $id = &Apache::response::start_response($parstack,$safeeval);
if ($target eq 'web') {
$result.=&geogebra_startcode();
+ $result.=&geogebra_spline_program();
+ $result.=&geogebra_default_parameters();
}
return $result;
}
@@ -64,8 +95,6 @@
sub end_functionplotresponse {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
&Apache::response::end_response;
- pop @Apache::lonxml::namespace;
-# &Apache::lonxml::deregister('Apache::optionresponse',('foilgroup','foil','conceptgroup','drawoptionlist'));
my $result;
# if ($target eq 'edit') { $result=&Apache::edit::end_table(); }
if ($target eq 'web') {
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.283 loncom/interface/lonhtmlcommon.pm:1.284
--- loncom/interface/lonhtmlcommon.pm:1.283 Mon Aug 30 02:55:17 2010
+++ loncom/interface/lonhtmlcommon.pm Mon Oct 4 14:34:46 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.283 2010/08/30 02:55:17 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.284 2010/10/04 14:34:46 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -62,6 +62,11 @@
use Apache::lonnet;
use LONCAPA;
+sub java_not_enabled {
+ return "\n".''.
+ &mt('The required Java applet could not be started. Please make sure to have Java installed and active in your browser.').
+ " \n";
+}
sub coursepreflink {
my ($text,$category)=@_;
--www1286202886--
From www@source.lon-capa.org Mon Oct 4 21:47:29 2010
From: www@source.lon-capa.org (www)
Date: Mon, 04 Oct 2010 20:47:29 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /homework functionplotresponse.pm
Message-ID:
This is a MIME encoded message
--www1286225249
Content-Type: text/plain
www Mon Oct 4 20:47:29 2010 EDT
Modified files:
/loncom/homework functionplotresponse.pm
Log:
Part of the server communication and comments
--www1286225249
Content-Type: text/plain
Content-Disposition: attachment; filename="www-20101004204729.txt"
Index: loncom/homework/functionplotresponse.pm
diff -u loncom/homework/functionplotresponse.pm:1.4 loncom/homework/functionplotresponse.pm:1.5
--- loncom/homework/functionplotresponse.pm:1.4 Mon Oct 4 19:26:39 2010
+++ loncom/homework/functionplotresponse.pm Mon Oct 4 20:47:29 2010
@@ -1,7 +1,7 @@
# LearningOnline Network with CAPA
# option list style responses
#
-# $Id: functionplotresponse.pm,v 1.4 2010/10/04 19:26:39 www Exp $
+# $Id: functionplotresponse.pm,v 1.5 2010/10/04 20:47:29 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -36,6 +36,11 @@
&Apache::lonxml::register('Apache::functionplotresponse',('functionplotresponse','backgroundplot'));
}
+#
+# There can be a number of applets on a page, each called ggbApplet_$id,
+# where $id is the "_"-concatenated part and responseid
+#
+
sub geogebra_startcode {
my ($id)=@_;
return (<\n";
}
+#
+# This is the internal GeoGebra bytecode which defines the spline functions
+#
sub geogebra_spline_program {
return (<
ENDSPLINEPROGRAM
}
+#
+# The standard set of parameters inside
+#
sub geogebra_default_parameters {
my ($id)=@_;
return(<
+# Each applet on the page will call function ggbOnInit when it is done loading
+# This function in turn will call the respective function registered by start_init_script
+# Which one of the registered functions is called is determined by ggbOnInitParam, which GeoGebra passes to ggbOnInit
+#
+
sub init_script {
if ($Apache::functionplotresponse::callscripts) {
return (<
+//
+
+ENDUPDATESCRIPT
+}
+
+#
+# Register the above update-handler for a variable
+#
+
+sub update_register {
+ my ($id,$variable)=@_;
+ return "document.ggbApplet_$id.registerObjectUpdateListener('$variable','updatePointCoordinates_$id')";
+}
+
+#
+# This registers the init-function call for ggbOnInit, which LON-CAPA will place at
+# It then starts the right headers
+#
sub start_init_script {
my ($id)=@_;
+# Add a line to ggbOnInit-function which calls the right function based on parameter passed from GeoGebra
$Apache::functionplotresponse::callscripts.="if (param=='applet_$id') { ggbInit_$id(); }\n";
+# ... and open this function
return (<
//
+#
sub start_backgroundplot {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
my $result='';
@@ -165,10 +227,14 @@
my $yaxisvisible=(&Apache::lonxml::get_param('yaxisvisible',$parstack,$safeeval)=~/on|true|1/i?'true':'false');
my $gridvisible=(&Apache::lonxml::get_param('gridvisible',$parstack,$safeeval)=~/on|true|1/i?'true':'false');
-
if ($target eq 'web') {
+# paste in the update routine to receive stuff back from the applet
+ $result.=&update_script($internalid);
+# start the initscript for this applet
$result.=&start_init_script($internalid);
+# put the axis commands inside
$result.=&axes_script($internalid,$xmin,$xmax,$ymin,$ymax,$xaxisvisible,$yaxisvisible,$gridvisible);
+# init script is left open
}
return $result;
}
@@ -182,10 +248,15 @@
# if ($target eq 'edit') { $result=&Apache::edit::end_table(); }
if ($target eq 'web') {
+# close the init script
$result.=&end_init_script();
+# actually start the -tag
$result.=&geogebra_startcode($internalid);
+# load the spline bytecode
$result.=&geogebra_spline_program();
+# set default parameters
$result.=&geogebra_default_parameters($internalid);
+# close the -tag
$result.=&geogebra_endcode();
}
return $result;
--www1286225249--
From raeburn@source.lon-capa.org Mon Oct 4 22:27:20 2010
From: raeburn@source.lon-capa.org (raeburn)
Date: Mon, 04 Oct 2010 21:27:20 -0000
Subject: [LON-CAPA-cvs] cvs: loncom(GCI_3) /interface lonnavdisplay.pm
Message-ID:
raeburn Mon Oct 4 21:27:20 2010 EDT
Modified files: (Branch: GCI_3)
/loncom/interface lonnavdisplay.pm
Log:
- Backport 1.17, 1.18.
Index: loncom/interface/lonnavdisplay.pm
diff -u loncom/interface/lonnavdisplay.pm:1.13 loncom/interface/lonnavdisplay.pm:1.13.6.1
--- loncom/interface/lonnavdisplay.pm:1.13 Tue Sep 8 20:56:47 2009
+++ loncom/interface/lonnavdisplay.pm Mon Oct 4 21:27:20 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Navigate Maps Handler
#
-# $Id: lonnavdisplay.pm,v 1.13 2009/09/08 20:56:47 raeburn Exp $
+# $Id: lonnavdisplay.pm,v 1.13.6.1 2010/10/04 21:27:20 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -139,7 +139,7 @@
$r->send_http_header;
# ------------------------------------------------------------ Get query string
- &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['register','sort','showOnlyHomework','postsymb']);
+ &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['sort','showOnlyHomework','postsymb','register']);
# ----------------------------------------------------- Force menu registration
my $body_only='';
@@ -163,11 +163,19 @@
$title = 'Course Contents';
$breadcrumb_text = &mt('Course Contents');
}
- $r->print(&Apache::loncommon::start_page($title,
- $js,
- {'only_body' => $body_only,
- 'force_register' => $env{'form.register'},
- 'bread_crumbs' => [{text => $breadcrumb_text }],}));
+ if ($env{'form.register'}) {
+ $args = {'force_register' => $env{'form.register'},
+ 'only_body' => $body_only};
+ $start_page = &Apache::loncommon::start_page($title,$js,$args);
+ } else {
+ my $brcrum = [{href => '/adm/navmaps',
+ text => $breadcrumb_text,
+ no_mt => 1},
+ ];
+ $args = {'bread_crumbs' => $brcrum,
+ 'only_body' => $body_only};
+ $start_page = &Apache::loncommon::start_page($title,$js,$args);
+ }
$r->print('');
$r->rflush();
@@ -268,8 +276,12 @@
."");
}
} else {
+ my $link = 'navmaps?jumpToFirstHomework';
+ if ($env{'form.register'}) {
+ $link .= '®ister='.$env{'form.register'};
+ }
&Apache::lonnavmaps::add_linkitem(\%toplinkitems,'firsthomework',
- 'location.href="navmaps?jumpToFirstHomework"',
+ 'location.href="'.$link.'"',
"Show my first due problem");
}
@@ -285,8 +297,12 @@
$filterFunc = sub { my $res = shift;
return $res->completable() || $res->is_map();
};
+ my $link = 'navmaps?sort='.$env{'form.sort'};
+ if ($env{'form.register'}) {
+ $link .= '®ister='.$env{'form.register'};
+ }
&Apache::lonnavmaps::add_linkitem(\%toplinkitems,'everything',
- 'location.href="navmaps?sort='.$env{'form.sort'}.'"',
+ 'location.href="'.$link.'"',
"Show everything");
$r->print("".&mt("Uncompleted Problems")." ");
$env{'form.filter'} = '';
@@ -300,18 +316,19 @@
}
my %selected=($env{'form.sort'} => ' selected="selected"');
- my $sort_html=("');
# renderer call
my $renderArgs = { 'cols' => [0,1,2,3],
'sort' => $env{'form.sort'},
From raeburn@source.lon-capa.org Mon Oct 4 23:30:43 2010
From: raeburn@source.lon-capa.org (raeburn)
Date: Mon, 04 Oct 2010 22:30:43 -0000
Subject: [LON-CAPA-cvs] cvs: loncom(GCI_3) /interface loncommon.pm
Message-ID:
raeburn Mon Oct 4 22:30:43 2010 EDT
Modified files: (Branch: GCI_3)
/loncom/interface loncommon.pm
Log:
- Backport 1.929.
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.925.2.14 loncom/interface/loncommon.pm:1.925.2.15
--- loncom/interface/loncommon.pm:1.925.2.14 Mon Oct 4 18:01:31 2010
+++ loncom/interface/loncommon.pm Mon Oct 4 22:30:42 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.925.2.14 2010/10/04 18:01:31 raeburn Exp $
+# $Id: loncommon.pm,v 1.925.2.15 2010/10/04 22:30:42 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -6158,6 +6158,11 @@
margin: 0.2em 0 0 0;
}
+span.LC_new_message{
+ font-weight:bold;
+ color: darkred;
+}
+
ol#LC_PathBreadcrumbs {
margin: 0;
}
From raeburn@source.lon-capa.org Tue Oct 5 00:00:46 2010
From: raeburn@source.lon-capa.org (raeburn)
Date: Mon, 04 Oct 2010 23:00:46 -0000
Subject: [LON-CAPA-cvs] cvs: loncom(GCI_3) /interface lonmenu.pm mydesk.tab
Message-ID:
This is a MIME encoded message
--raeburn1286233246
Content-Type: text/plain
raeburn Mon Oct 4 23:00:46 2010 EDT
Modified files: (Branch: GCI_3)
/loncom/interface mydesk.tab lonmenu.pm
Log:
- Customization for GCI_3
- Home link in primary menu for GCI Faculty users points at /adm/gci_info
- Preferences link in primary menu.
- Elimination of Main Menu in most GCI contexts
lonmenu.pm - Backport 1.312, 1.323, 1.324, 1.339.
- Modified Main Menu for Course Coordinators of Concept Tests.
mydesk.tab - Backport 1.134 (part).
--raeburn1286233246
Content-Type: text/plain
Content-Disposition: attachment; filename="raeburn-20101004230046.txt"
Index: loncom/interface/mydesk.tab
diff -u loncom/interface/mydesk.tab:1.125 loncom/interface/mydesk.tab:1.125.4.1
--- loncom/interface/mydesk.tab:1.125 Wed Dec 16 14:21:59 2009
+++ loncom/interface/mydesk.tab Mon Oct 4 23:00:46 2010
@@ -16,8 +16,12 @@
# - courses: show Courses instead of Roles
# prim:link:icon:alt:text:condition
prim:gotop('/adm/about.html'):/adm/lonIcons/minilogo.gif:LON-CAPA Logo:About:public
+prim:gotop('/adm/menu'):::Home:home
+prim:gotop('/adm/roles?destinationurl=/adm/gci_info'):::Home:gci
+prim:gotop('/adm/menu'):::Home:gcitest
prim:gotop('/adm/communicate'):::Messages:nonewmsg
prim:gotop('/adm/communicate'):::New Messages:newmsg
+prim:gotop('/adm/preferences'):::Preferences:
prim:gotop('/adm/roles'):::Roles:roles
prim:gotop('/adm/roles'):::Courses:courses
prim:gotop('/adm/roles'):::Log In:onlypublic
@@ -46,8 +50,7 @@
# - noremotenavCommunity: remote navmap is _not_ activated
# and course is of type Community
# prim:link:icon:alt:text:condition
-scnd:/adm/menu:::Main Menu:always
-scnd:/adm/flip?postdata=return%3a:::Return to Last Location:showreturn
+scnd:/adm/menu:::Main Menu:showmenu
scnd:/adm/navmaps?postdata=[url]&postsymb=[symb]:::Course Contents:noremotenav
scnd:/adm/navmaps?postdata=[url]&postsymb=[symb]:::Course Contents:remotenav
scnd:/adm/navmaps?postdata=[url]&postsymb=[symb]:::Community Contents:noremotenavCommunity
@@ -55,7 +58,8 @@
scnd:/adm/coursedocs:::Course Editor:mdcCourse
scnd:/adm/coursedocs:::Community Editor:mdcCommunity
scnd:/adm/coursegroups:::Groups:showgroups
-scnd:/adm/roles:::Roles:
+scnd:/adm/roles:::Roles:showroles
+scnd:/adm/flip?postdata=return%3a:::Return to Last Location:showreturn
# Categories
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.309.2.15 loncom/interface/lonmenu.pm:1.309.2.16
--- loncom/interface/lonmenu.pm:1.309.2.15 Fri Sep 3 19:20:47 2010
+++ loncom/interface/lonmenu.pm Mon Oct 4 23:00:46 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.309.2.15 2010/09/03 19:20:47 raeburn Exp $
+# $Id: lonmenu.pm,v 1.309.2.16 2010/10/04 23:00:46 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -151,6 +151,9 @@
} else { # textual Link
$link = &mt($$menuitem[3]);
}
+ if($$menuitem[4] eq 'newmsg'){ #special style for New Messages
+ return ''.$link.' ';
+ }
return ''.$link.' ';
}
@@ -177,6 +180,12 @@
next if $$menuitem[4] eq 'onlypublic'# hide links which are
&& $env{'user.name'} ne 'public' # only visible to public
&& $env{'user.domain'} ne 'public'; # users
+ next if $$menuitem[4] eq 'gci'
+ && (!$custommenu || $env{'request.role'} =~ m{^st\./gcitest/});
+ next if $$menuitem[4] eq 'home'
+ && $custommenu;
+ next if $$menuitem[4] eq 'gcitest'
+ && $env{'user.domain'} eq 'gci';
next if $$menuitem[4] eq 'roles' # hide links which are
&& $custommenu; # not visible when GCI
next if $$menuitem[4] eq 'courses' # tabbed interface in use
@@ -213,11 +222,13 @@
$env{'user.domain'}, $env{'user.name'},
$env{'course.' . $env{'request.course.id'} . '.domain'},
$env{'course.' . $env{'request.course.id'} . '.num'});
+ my $custommenu = &Apache::loncommon::needs_gci_custom();
+ my $numdc = &Apache::loncommon::check_for_gci_dc();
foreach my $menuitem (@secondary_menu) {
# evaluate conditions
next if ref($menuitem) ne 'ARRAY';
- next if $$menuitem[4] ne 'always'
- && !$env{'request.course.id'};
+ next if $$menuitem[4] eq 'showmenu'
+ && ($custommenu || !$numdc);
next if $$menuitem[4] eq 'showreturn'
&& !$showlink
&& !($env{'request.state'} eq 'construct');
@@ -238,8 +249,9 @@
next if $$menuitem[4] =~ /showgroups$/
&& !$canviewgrps
&& !%groups;
-
- if ($$menuitem[3] eq 'Roles' && $env{'request.course.id'}) {
+ next if $$menuitem[4] eq 'showroles'
+ && ($custommenu || !$numdc);
+ if ($$menuitem[3] eq 'Roles' && $env{'request.course.id'} && !$custommenu) {
# special treatment for role selector
my $roles_selector = &roles_selector(
$env{'course.' . $env{'request.course.id'} . '.domain'},
@@ -517,6 +529,10 @@
}
sub show_return_link {
+ if (($env{'request.noversionuri'} =~ m{^/adm/(viewclasslist|navmaps)($|\?)})
+ || ($env{'request.noversionuri'} =~ m{^/adm/.*/aboutme($|\?)})) {
+ return if ($env{'form.register'});
+ }
return (($env{'request.noversionuri'}=~m{^/(res|public)/} &&
$env{'request.symb'} eq '')
||
@@ -525,7 +541,7 @@
(($env{'request.noversionuri'}=~/^\/adm\//) &&
($env{'request.noversionuri'}!~/^\/adm\/wrapper\//) &&
($env{'request.noversionuri'}!~
- m[^/adm/.*/(smppg|bulletinboard|aboutme)($|\?)])
+ m[^/adm/.*/(smppg|bulletinboard)($|\?)])
));
}
@@ -598,9 +614,13 @@
} else {
$contentstext = &mt('Course Contents');
}
- my @crumbs = ({text => $contentstext,
- href => "Javascript:gonav('/adm/navmaps')"});
-
+ my @crumbs;
+ unless (($forcereg) && ($env{'request.noversionuri'} eq '/adm/navmaps')
+ && ($mapurl eq $env{'course.'.$env{'request.course.id'}.'.url'})) {
+ @crumbs = ({text => Apache::loncommon::course_type()
+ . ' Contents',
+ href => "Javascript:gopost('/adm/navmaps','')"});
+ }
if ($mapurl ne $env{'course.'.$env{'request.course.id'}.'.url'}) {
push(@crumbs, {text => '...',
no_mt => 1});
@@ -844,7 +864,7 @@
"&go('/adm/requestcourse')&Course requests\n";
}
}
- unless ($env{'request.noversionuri'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme)(\?|$)/) {
+ unless ($env{'request.noversionuri'}=~/\/(bulletinboard|smppg|navmaps|syllabus|aboutme|portfolio)(\?|$)/) {
if ((!$env{'request.enc'}) && ($env{'request.noversionuri'} !~ m{^/adm/wrapper/ext/})) {
$menuitems.=(<'.
- ''.
- ''.
- '
'.&mt('Utilities').' '.
- '
';
- if ($context eq 'gcicustom') {
- my $createtext = &mt('Create Concept Test');
- if ($switcher) {
- $createtext = &mt('Create New Test');
+ if ($context eq 'gcicustom') {
+ my (%can_request,%request_domains,$canreq,$createtext);
+ my $role = 'st';
+ my $custommenu = &Apache::loncommon::needs_gci_custom();
+ if ($custommenu) {
+ $role = 'cc';
+ }
+ my %courses = &Apache::loncommon::existing_gcitest_courses($role);
+ my $numcourses = keys(%courses);
+ my ($switcher_js,$switcher);
+ my $formname = 'testpicker';
+ if ($numcourses > 0) {
+ $switcher = &Apache::loncommon::gcitest_switcher($role,$formname,%courses);
+ my $current;
+ my $cid = $env{'request.course.id'};
+ if ($cid) {
+ $current = $role.'./'.$env{'course.'.$cid.'.domain'}.
+ '/'.$env{'course.'.$cid.'.num'};
+ }
+ $switcher_js = &Apache::loncommon::gcitest_switcher_js($current,$numcourses,$formname);
+ if ($switcher_js) {
+ $switcher_js= <<"ENDSCRIPT";
+
+
+ENDSCRIPT
}
- $output .= ' ';
+ $switcher = $switcher_js.$switcher;
}
- if ($switcher) {
- $output .= ' ';
+ if ($env{'user.domain'} eq 'gci') {
+ $canreq =
+ &Apache::lonnet::check_can_request('gcitest',\%can_request,\%request_domains);
+ $createtext = &mt('Create Concept Test');
+ if ($numcourses) {
+ $createtext = &mt('Create New Test');
+ }
}
- $output .= ' '.
-' ';
if ($env{'request.course.id'}) {
- if (($context eq 'gcicustom') && (&Apache::lonnet::allowed('mdc',$env{'request.course.id'}))) {
- $output.= '
'.
- ''.
- ' ';
+ if (&Apache::lonnet::allowed('mdc',$env{'request.course.id'})) {
+ $output .=
+ ' ';
} else {
my $navtext = &mt('Table of Contents');
+ my $navdesc = &mt('Display Table of Contents for Geoscience Concept Inventory');
if ($env{'request.role.domain'} eq 'gcitest') {
$navtext = &mt('Display Test Contents');
+ $navdesc = &mt('Display the table of contents for this Concept Test');
+ }
+ $output .=
+ ' ';
+ }
+ } elsif ($switcher || $canreq) {
+ $output .= ' '.
+ ' ';
- }
- if ($context eq 'gcinorole') {
- my $queued = &Apache::loncoursequeueadmin::queued_selfenrollment('notitle');
- if ($queued) {
- $output .= ''.
- ''.
- '
'.&mt('Pending Enrollment Requests').' '.
- $queued.
- ' ';
+ if ($switcher) {
+ $output .= ''.&mt('Select Concept Test').' '.
+ ''.$switcher.' ';
}
+ $output .= ' ';
+ }
+ } elsif ($context eq 'gcinorole') {
+ my $queued = &Apache::loncoursequeueadmin::queued_selfenrollment('notitle');
+ if ($queued) {
+ $output .=
+ ''.
+ '
'.&mt('Pending Enrollment Requests').' '.
+ $queued.
+ '
';
}
- $output.='';
} else {
# calling rawconfig with "1" will evaluate mydesk.tab,
# even if there is no active remote control
@@ -1801,7 +1880,6 @@
if (caller == 'tutorial') {
document.location.href = '/adm/roles?selectrole=1&st./gci/5422913620b814c90gcil1=1';
}
-
return;
}
@@ -2255,7 +2333,7 @@
secok = 0;
var numrolesec = rolesections[selidx].length;
var msgidx = numsec[selidx] - numrolesec;
- secchoice = prompt("$lt{'this'}\\n"+secpick[msgidx]+"\\n$lt{'avai'} "+roleseclist[selidx],"");
+ secchoice = prompt("$lt{'this'} "+secpick[msgidx]+"\\n$lt{'avai'} "+roleseclist[selidx],"");
if (secchoice == '') {
if (msgidx > 0) {
secok = 1;
--raeburn1286233246--
From www@source.lon-capa.org Tue Oct 5 02:28:00 2010
From: www@source.lon-capa.org (www)
Date: Tue, 05 Oct 2010 01:28:00 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /homework functionplotresponse.pm
Message-ID:
www Tue Oct 5 01:28:00 2010 EDT
Modified files:
/loncom/homework functionplotresponse.pm
Log:
Now draws splines
Index: loncom/homework/functionplotresponse.pm
diff -u loncom/homework/functionplotresponse.pm:1.6 loncom/homework/functionplotresponse.pm:1.7
--- loncom/homework/functionplotresponse.pm:1.6 Tue Oct 5 00:10:07 2010
+++ loncom/homework/functionplotresponse.pm Tue Oct 5 01:28:00 2010
@@ -1,7 +1,7 @@
# LearningOnline Network with CAPA
# option list style responses
#
-# $Id: functionplotresponse.pm,v 1.6 2010/10/05 00:10:07 www Exp $
+# $Id: functionplotresponse.pm,v 1.7 2010/10/05 01:28:00 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -214,12 +214,27 @@
}
#
-# Subroutine that generates spline $label based on stored information
+# Subroutine that generates code for spline $label based on stored information
#
sub generate_spline {
my ($id,$label)=@_;
my $result='';
+ my $order=$Apache::functionplotresponse::splineorder{$label};
+ my $x=$Apache::functionplotresponse::splineinitx{$label};
+ my $y=$Apache::functionplotresponse::splineinity{$label};
+ my $sx=$Apache::functionplotresponse::splinescalex{$label};
+ my $sy=$Apache::functionplotresponse::splinescaley{$label};
+ my @coords=();
+ foreach my $i (1..$order) {
+ $result.=&new_coordinate($id,$label.'P'.$i,$x,$y);
+ $x+=$sx/$order;
+ push(@coords,$label.'P'.$i);
+ $result.=&new_coordinate($id,$label.'S'.$i,$x,$y+$sy);
+ $x+=$sx/$order;
+ push(@coords,$label.'S'.$i);
+ }
+ $result.='document.ggbApplet_'.$id.'.evalCommand("Spline'.$order.'['.join(',',@coords).']");'."\n";
return $result;
}
#
@@ -273,6 +288,7 @@
my $sy=&Apache::lonxml::get_param('scaley',$parstack,$safeeval);
unless ($sy) { $sy=2; }
$Apache::functionplotresponse::splinescaley{$label}=$sy;
+ return '';
}
sub end_spline {
From raeburn@source.lon-capa.org Mon Oct 4 20:43:31 2010
From: raeburn@source.lon-capa.org (raeburn)
Date: Mon, 04 Oct 2010 19:43:31 -0000
Subject: [LON-CAPA-cvs] cvs: loncom(GCI_3) /interface lonhtmlcommon.pm
Message-ID:
raeburn Mon Oct 4 19:43:31 2010 EDT
Modified files: (Branch: GCI_3)
/loncom/interface lonhtmlcommon.pm
Log:
- Customization for GCI_3
- Elimination of Main Menu for Concept Tests.
- First item in breadcrumbs is Contents instead of Main Menu.
- Second arg passed to &render_advtools() is legend, to create
legend in tertiary menu.
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.253.2.3 loncom/interface/lonhtmlcommon.pm:1.253.2.4
--- loncom/interface/lonhtmlcommon.pm:1.253.2.3 Mon Oct 4 19:19:15 2010
+++ loncom/interface/lonhtmlcommon.pm Mon Oct 4 19:43:30 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.253.2.3 2010/10/04 19:19:15 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.253.2.4 2010/10/04 19:43:30 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1382,20 +1382,28 @@
return unless($last);
} else {
my $description = 'Menu';
+ my $href = '/adm/menu';
+ my $tooltip = 'Go to main menu';
my $no_mt_descr = 0;
if ((exists($env{'request.course.id'})) &&
- ($env{'request.course.id'} ne '') &&
- ($env{'course.'.$env{'request.course.id'}.'.description'} ne '')) {
- $description =
- $env{'course.'.$env{'request.course.id'}.'.description'};
- $no_mt_descr = 1;
+ ($env{'request.course.id'} ne '')) {
+
+ if ((&Apache::loncommon::needs_gci_custom()) || ($env{'user.domain'} eq 'gcitest')) {
+ $href = '/adm/navmaps';
+ $tooltip = 'Contents';
+ }
+ if ($env{'course.'.$env{'request.course.id'}.'.description'} ne '') {
+ $description =
+ $env{'course.'.$env{'request.course.id'}.'.description'};
+ $no_mt_descr = 1;
+ }
}
- $menulink = { href =>'/adm/menu',
- title =>'Go to main menu',
- target =>'_top',
- text =>$description,
- no_mt =>$no_mt_descr, };
- if($last) {
+ $menulink = { href => $href,
+ title => $tooltip,
+ target => '_top',
+ text => $description,
+ no_mt => $no_mt_descr, };
+ if ($last) {
#$last set, so we have some crumbs
unshift(@Crumbs,$menulink);
} else {
@@ -1433,7 +1441,7 @@
# last breadcrumb is the first order heading of a page
# for course breadcrumbs it's just bold
$links .= htmltag( 'li', htmltag($CourseBreadcrumbs ? 'b' : 'h1',
- $lasttext), {title => $lasttext});
+ $lasttext), {title => $lasttext});
my $icons = '';
$faq = $last->{'faq'} if (exists($last->{'faq'}));
@@ -1568,7 +1576,7 @@
{ listattr => { class=>'LC_breadcrumb_tools_outerlist' } });
}
-=item render_advtools(\$breadcrumbs)
+=item render_advtools(\$breadcrumbs,$legend)
Creates html for advanced tools (category advtools) and inserts \$breadcrumbs
at the correct position.
@@ -1580,12 +1588,15 @@
=cut
sub render_advtools {
- my ($breadcrumbs) = @_;
+ my ($breadcrumbs,$legend) = @_;
return unless (defined $tools{'advtools'})
and (scalar(@{$tools{'advtools'}}) > 0);
-
+ my $args;
+ if ($legend) {
+ $args = {legend => $legend};
+ }
$$breadcrumbs .= Apache::loncommon::head_subbox(
- funclist_from_array($tools{'advtools'}) );
+ funclist_from_array($tools{'advtools'},$args));
}
} # End of scope for @Crumbs
From raeburn@source.lon-capa.org Mon Oct 4 18:43:24 2010
From: raeburn@source.lon-capa.org (raeburn)
Date: Mon, 04 Oct 2010 17:43:24 -0000
Subject: [LON-CAPA-cvs] cvs: loncom(GCI_3) /auth lonroles.pm
Message-ID:
raeburn Mon Oct 4 17:43:24 2010 EDT
Modified files: (Branch: GCI_3)
/loncom/auth lonroles.pm
Log:
- Customization for GCI_3
- gctest_switcher() and gcitest_switcher_js() moved from lonmainmenu.pm to loncommon.pm
- No breadcrumbs for /adm/gci_info
- Woding change - more than a single question can be submitted to the GCI WebCenter.
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.240.2.16 loncom/auth/lonroles.pm:1.240.2.17
--- loncom/auth/lonroles.pm:1.240.2.16 Fri Sep 3 19:20:51 2010
+++ loncom/auth/lonroles.pm Mon Oct 4 17:43:24 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# User Roles Screen
#
-# $Id: lonroles.pm,v 1.240.2.16 2010/09/03 19:20:51 raeburn Exp $
+# $Id: lonroles.pm,v 1.240.2.17 2010/10/04 17:43:24 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -138,7 +138,6 @@
use Apache::lonlocal;
use Apache::lonpageflip();
use Apache::lonnavdisplay();
-use Apache::lonmainmenu();
use Apache::loncoursequeueadmin;
use GDBM_File;
use LONCAPA qw(:DEFAULT :match);
@@ -595,8 +594,11 @@
my ($crumbtext,$pagetitle,$recent,$show_course);
my $noscript=''.&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.').' '.&mt('As this is not the case, most functionality in the system will be unavailable.').' ';
if ($custommenu) {
- my $start_page = &Apache::loncommon::start_page('Main Menu',undef,
- {'bread_crumbs' => 1});
+ my $brcrum = {'bread_crumbs' => 1};
+ if ($env{'form.destinationurl'} eq '/adm/gci_info') {
+ undef($brcrum);
+ }
+ my $start_page = &Apache::loncommon::start_page('Main Menu',undef,$brcrum);
$r->print(<<"ENDCUSTOM");
$start_page
@@ -748,13 +750,13 @@
my $numcourses = keys(%courses);
my $switcher;
if ($numcourses > 0) {
- $switcher = &Apache::lonmainmenu::gcitest_switcher('cc',%courses);
+ $switcher = &Apache::loncommon::gcitest_switcher('cc',%courses);
my $current;
if ($env{'request.course.id'}) {
$current = 'cc./'.$env{'course.'.$env{'request.course.id'}.'.domain'}.
'/'.$env{'course.'.$env{'request.course.id'}.'.num'};
}
- my $switcher_js = &Apache::lonmainmenu::gcitest_switcher_js($current,$numcourses);
+ my $switcher_js = &Apache::loncommon::gcitest_switcher_js($current,$numcourses);
$r->print(<<"ENDSCRIPT");
+ENDGGBINIT
+ }
+}
+
+sub start_init_script {
+ my ($id)=@_;
+ $Apache::functionplotresponse::callscripts.="if (param=='applet_$id') { ggbInit_$id(); }\n";
+ return (<
+//
+
+ENDENDINIT
+}
+
sub start_functionplotresponse {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
my $result='';
- my $id = &Apache::response::start_response($parstack,$safeeval);
+ my $internalid = $Apache::inputtags::part.'_'.&Apache::response::start_response($parstack,$safeeval);
+ my $xmin=&Apache::lonxml::get_param('xmin',$parstack,$safeeval);
+ my $xmax=&Apache::lonxml::get_param('xmax',$parstack,$safeeval);
+ my $ymin=&Apache::lonxml::get_param('ymin',$parstack,$safeeval);
+ my $ymax=&Apache::lonxml::get_param('ymax',$parstack,$safeeval);
+ my $xaxisvisible=&Apache::lonxml::get_param('xaxisvisible',$parstack,$safeeval);
+ my $yaxisvisible=&Apache::lonxml::get_param('yaxisvisible',$parstack,$safeeval);
+ my $gridvisible=&Apache::lonxml::get_param('gridvisible',$parstack,$safeeval);
+
+
if ($target eq 'web') {
- $result.=&geogebra_startcode();
- $result.=&geogebra_spline_program();
- $result.=&geogebra_default_parameters();
+ $result.=&start_init_script($internalid);
}
return $result;
}
@@ -95,9 +137,16 @@
sub end_functionplotresponse {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
&Apache::response::end_response;
+
my $result;
+ my $internalid = $Apache::inputtags::part.'_'.$Apache::inputtags::response[-1];
+
# if ($target eq 'edit') { $result=&Apache::edit::end_table(); }
if ($target eq 'web') {
+ $result.=&end_init_script();
+ $result.=&geogebra_startcode($internalid);
+ $result.=&geogebra_spline_program();
+ $result.=&geogebra_default_parameters($internalid);
$result.=&geogebra_endcode();
}
return $result;
Index: loncom/homework/structuretags.pm
diff -u loncom/homework/structuretags.pm:1.475 loncom/homework/structuretags.pm:1.476
--- loncom/homework/structuretags.pm:1.475 Mon Aug 30 14:06:16 2010
+++ loncom/homework/structuretags.pm Mon Oct 4 18:28:53 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# definition of tags that give a structure to a document
#
-# $Id: structuretags.pm,v 1.475 2010/08/30 14:06:16 raeburn Exp $
+# $Id: structuretags.pm,v 1.476 2010/10/04 18:28:53 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -783,6 +783,7 @@
&Apache::lonhomework::reset_show_problem_status();
$Apache::lonhomework::ignore_response_errors=1;
}
+ $Apache::functionplotresponse::callscripts='';
@Apache::inputtags::responselist = ();
@Apache::inputtags::importlist = ();
@Apache::inputtags::previous=();
@@ -810,6 +811,7 @@
undef($Apache::lonhomework::type);
undef($Apache::lonhomework::scantronmode);
undef($Apache::lonhomework::ignore_response_errors);
+ undef($Apache::functionplotresponse::callscripts);
&Apache::lonhomework::reset_show_problem_status();
}
@@ -1202,6 +1204,9 @@
}
}
}
+ if ($target eq 'web') {
+ $result.=&Apache::functionplotresponse::init_script();
+ }
if ($target eq 'grade') {
&Apache::lonhomework::showhash(%Apache::lonhomework::results);
&finalize_storage();
From raeburn@source.lon-capa.org Mon Oct 4 20:19:15 2010
From: raeburn@source.lon-capa.org (raeburn)
Date: Mon, 04 Oct 2010 19:19:15 -0000
Subject: [LON-CAPA-cvs] cvs: loncom(GCI_3) /interface lonhtmlcommon.pm
Message-ID:
This is a MIME encoded message
--raeburn1286219955
Content-Type: text/plain
raeburn Mon Oct 4 19:19:15 2010 EDT
Modified files: (Branch: GCI_3)
/loncom/interface lonhtmlcommon.pm
Log:
- Customization for GCI_3
- Backport 1.261, 1.274.
--raeburn1286219955
Content-Type: text/plain
Content-Disposition: attachment; filename="raeburn-20101004191915.txt"
Index: loncom/interface/lonhtmlcommon.pm
diff -u loncom/interface/lonhtmlcommon.pm:1.253.2.2 loncom/interface/lonhtmlcommon.pm:1.253.2.3
--- loncom/interface/lonhtmlcommon.pm:1.253.2.2 Tue Dec 8 05:19:08 2009
+++ loncom/interface/lonhtmlcommon.pm Mon Oct 4 19:19:15 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common html routines
#
-# $Id: lonhtmlcommon.pm,v 1.253.2.2 2009/12/08 05:19:08 raeburn Exp $
+# $Id: lonhtmlcommon.pm,v 1.253.2.3 2010/10/04 19:19:15 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1383,6 +1383,13 @@
} else {
my $description = 'Menu';
my $no_mt_descr = 0;
+ if ((exists($env{'request.course.id'})) &&
+ ($env{'request.course.id'} ne '') &&
+ ($env{'course.'.$env{'request.course.id'}.'.description'} ne '')) {
+ $description =
+ $env{'course.'.$env{'request.course.id'}.'.description'};
+ $no_mt_descr = 1;
+ }
$menulink = { href =>'/adm/menu',
title =>'Go to main menu',
target =>'_top',
@@ -1403,23 +1410,30 @@
$bug = $_->{'bug'} if (exists($_->{'bug'}));
$help = $_->{'help'} if (exists($_->{'help'}));
- my $result = htmltag( 'a',
- $_->{no_mt} ?
- $_->{text} : mt($_->{text}),
+ my $result = $_->{no_mt} ? $_->{text} : mt($_->{text});
+
+ if ($_->{href}){
+ $result = htmltag( 'a', $result,
{
href => $_->{href},
title => $_->{no_mt} ?
$_->{title} : mt($_->{title}),
target => $_->{target},
});
+ }
+
$result = htmltag( 'li', "$result $crumbsymbol");
- } @Crumbs;
+ } @Crumbs;
#should the last Element be translated?
- $links .= htmltag( 'li',
- htmltag( 'b',
- $last->{'no_mt'} ?
- $last->{'text'} : mt($last->{'text'}) ));
+
+ my $lasttext = $last->{'no_mt'} ? $last->{'text'}
+ : mt( $last->{'text'} );
+
+ # last breadcrumb is the first order heading of a page
+ # for course breadcrumbs it's just bold
+ $links .= htmltag( 'li', htmltag($CourseBreadcrumbs ? 'b' : 'h1',
+ $lasttext), {title => $lasttext});
my $icons = '';
$faq = $last->{'faq'} if (exists($last->{'faq'}));
@@ -1454,12 +1468,10 @@
.$links;
}
- #SD START (work in progress!)
- add_tools(\$links);
- #SD END
+ render_tools(\$links);
$links = htmltag('div', $links,
{ id => "LC_breadcrumbs" }) unless ($CourseBreadcrumbs) ;
- add_advtools(\$links);
+ render_advtools(\$links);
# Return the @Crumbs stack to what we started with
push(@Crumbs,$last);
@@ -1477,55 +1489,104 @@
push(@Crumbs,@_);
}
+=item add_breadcrumb_tool($category, $html)
+
+Adds $html to $category of the breadcrumb toolbar container.
+
+$html is usually a link to a page that invokes a function on the currently
+displayed data (e.g. print when viewing a problem)
+
+Currently there are 3 possible values for $category:
+
+=over
+
+=item navigation
+left of breadcrumbs line
+
+=item tools
+right of breadcrumbs line
+
+=item advtools
+advanced tools shown in a separate box below breadcrumbs line
+
+=back
+
+returns: nothing
+
+=cut
- #SD START (work in progress!)
sub add_breadcrumb_tool {
- my ($category, $html) = @_;
- return unless $html;
- if (!defined(%tools)) {
- my %tools = ( A => [], B => [], C => []);
+ my ($category, @html) = @_;
+ return unless @html;
+ if (!defined(%tools)) {
+ %tools = ( navigation => [], tools => [], advtools => []);
+ }
+
+ #this cleans data received from lonmenu::innerregister
+ @html = grep {defined $_ && $_ ne ''} @html;
+ for (@html) {
+ s/align="(right|left)"//;
+ s/// if $category ne 'advtools';
}
- push @{$tools{$category}}, $html;
+
+ push @{$tools{$category}}, @html;
}
+=item clear_breadcrumb_tools()
+
+Clears the breadcrumb toolbar container.
+
+returns: nothing
+
+=cut
+
sub clear_breadcrumb_tools {
undef(%tools);
}
- sub add_tools {
- my ($links) = @_;
+=item render_tools(\$breadcrumbs)
+
+Creates html for breadcrumb tools (categories navigation and tools) and inserts
+\$breadcrumbs at the correct position.
+
+input: \$breadcrumbs - a reference to the string containing prepared
+breadcrumbs.
+
+returns: nothing
+=cut
+
+#TODO might split this in separate functions for each category
+ sub render_tools {
+ my ($breadcrumbs) = @_;
return unless defined %tools;
- my $html = '';
- for my $category ('A','B') {
- $html .= ''
- . ' ';
- if ($category eq 'A') { $html .= "$$links "; }
- }
- $$links = $html.' ';
- }
-
- sub add_advtools {
- my ($links) = @_;
- return unless (defined $tools{'C'}) and (scalar (@{$tools{'C'}}) > 0);
- my $html = start_funclist();
- for my $item (@{$tools{'C'}}){
- next unless $item;
- $item =~ s/align="(right|left)"//;
- $html .= add_item_funclist($item);
- }
- $html .= end_funclist();
- $html = Apache::loncommon::head_subbox($html);
- $$links .= $html;
+
+ my $navigation = list_from_array($tools{navigation},
+ { listattr => { class=>"LC_breadcrumb_tools_navigation" } });
+ my $tools = list_from_array($tools{tools},
+ { listattr => { class=>"LC_breadcrumb_tools_tools" } });
+ $$breadcrumbs = list_from_array([$navigation, $tools, $$breadcrumbs],
+ { listattr => { class=>'LC_breadcrumb_tools_outerlist' } });
+ }
+
+=item render_advtools(\$breadcrumbs)
+
+Creates html for advanced tools (category advtools) and inserts \$breadcrumbs
+at the correct position.
+
+input: \$breadcrumbs - a reference to the string containing prepared
+breadcrumbs (after render_tools call).
+
+returns: nothing
+=cut
+
+ sub render_advtools {
+ my ($breadcrumbs) = @_;
+ return unless (defined $tools{'advtools'})
+ and (scalar(@{$tools{'advtools'}}) > 0);
+
+ $$breadcrumbs .= Apache::loncommon::head_subbox(
+ funclist_from_array($tools{'advtools'}) );
}
- #SD END
} # End of scope for @Crumbs
@@ -1658,7 +1719,6 @@
} # End: row_count block for pick_box
-
sub role_select_row {
my ($roles,$title,$css_class,$show_separate_custom,$cdom,$cnum) = @_;
my $crstype = 'Course';
@@ -1905,7 +1965,6 @@
##############################################
##############################################
-
# echo_form_input
#
# Generates html markup to add form elements from the referrer page
@@ -1970,7 +2029,6 @@
##############################################
##############################################
-
# set_form_elements
#
# Generates javascript to set form elements to values based on
@@ -2188,7 +2246,7 @@
# USAGE: inittags(@tags);
#
# EXAMPLES:
-# - my ($h1, $h2, $h3) = initTags( qw( h1 h2 h3 ) )
+# - my ($h1, $h2, $h3) = inittags( qw( h1 h2 h3 ) )
# $h1->("This is a headline") #Returns: This is a headline
#
# NOTES: See sub htmltag for further information.
@@ -2237,6 +2295,39 @@
};
+=item list_from_array( \@array, { listattr =>{}, itemattr =>{} } )
+
+Constructs a XHTML list from \@array.
+
+input:
+
+=over
+
+=item \@array
+
+A reference to the array containing text that will be wrapped in tags.
+
+=item { listattr => {}, itemattr =>{} }
+
+Attributes for and passed in as hash references.
+See htmltag() for more details.
+
+=back
+
+returns: XHTML list as String.
+
+=cut
+
+# \@items, {listattr => { class => 'abc', id => 'xyx' }, itemattr => {class => 'abc', id => 'xyx'}}
+sub list_from_array {
+ my ($items, $args) = @_;
+ return unless scalar @$items;
+ my ($ul, $li) = inittags( qw(ul li) );
+ my $listitems = join '', map { $li->($_, $args->{itemattr}) } @$items;
+ return $ul->( $listitems, $args->{listattr} );
+}
+
+
##############################################
##############################################
@@ -2266,12 +2357,6 @@
#
# Outputs: A scalar containing the html markup for the menu.
-# ---- Remove when done ----
-# This routine is part of the redesign of LON-CAPA and it's
-# subject to change during this project.
-# Don't rely on its current functionality as it might be
-# changed or removed.
-# --------------------------
sub generate_menu {
my @menu = @_;
# subs for specific html elements
@@ -2287,11 +2372,15 @@
# create the markup for the current $link and push it into @links.
# each entry consists of an image and a text optionally followed
# by a help link.
+ my $src;
+ if ($$link{icon} ne '') {
+ $src = '/res/adm/pages/'.$$link{icon};
+ }
push(@links,$li->(
$a->(
$img->("", {
class => "LC_noBorder LC_middle",
- src => "/res/adm/pages/$$link{icon}",
+ src => $src,
alt => mt(defined($$link{alttext}) ?
$$link{alttext} : $$link{linktext})
}), {
@@ -2394,9 +2483,6 @@
return ' '.$content.' '."\n";
}
-##############################################
-##############################################
-
=pod
=item &end_funclist
@@ -2412,16 +2498,46 @@
Inputs: ./.
Returns: HTML code with function list end
-
=cut
-##############################################
-##############################################
-
sub end_funclist {
return " \n";
}
+=pod
+
+=item funclist_from_array( \@array, {legend => 'text for legend'} )
+
+Constructs a XHTML list from \@array with the first item being visually
+highlighted and set to the value of legend or 'Functions' if legend is
+empty.
+
+=over
+
+=item \@array
+
+A reference to the array containing text that will be wrapped in tags.
+
+=item { legend => 'text' }
+
+A string that's used as visually highlighted first item. 'Functions' is used if
+it's value evaluates to false.
+
+=back
+
+returns: XHTML list as string.
+
+=back
+
+=cut
+
+sub funclist_from_array {
+ my ($items, $args) = @_;
+ $args->{legend} ||= mt('Functions');
+ return list_from_array( [$args->{legend}, @$items],
+ { listattr => {class => 'LC_funclist'} });
+}
+
1;
__END__
--raeburn1286219955--
From www@source.lon-capa.org Mon Oct 4 16:13:17 2010
From: www@source.lon-capa.org (www)
Date: Mon, 04 Oct 2010 15:13:17 -0000
Subject: [LON-CAPA-cvs] cvs: modules /gerd/geogebra xml_draft.problem
Message-ID:
www Mon Oct 4 15:13:17 2010 EDT
Added files:
/modules/gerd/geogebra xml_draft.problem
Log:
Early draft for what the XML would look like
Index: modules/gerd/geogebra/xml_draft.problem
+++ modules/gerd/geogebra/xml_draft.problem
blah
// xunc & yunc mean 5% of the total size of the graph. So xunc is 5% of 20, and yunc is 5% of 16. dyunc is (ymax-ymin)/(xmax-xmin) and dy2unc is (ymax-ymin)/(xmax-xmin)^2.
blah blah
From raeburn@source.lon-capa.org Mon Oct 4 22:51:22 2010
From: raeburn@source.lon-capa.org (raeburn)
Date: Mon, 04 Oct 2010 21:51:22 -0000
Subject: [LON-CAPA-cvs] cvs: loncom(GCI_3) /interface lonnavdisplay.pm
Message-ID:
raeburn Mon Oct 4 21:51:22 2010 EDT
Modified files: (Branch: GCI_3)
/loncom/interface lonnavdisplay.pm
Log:
- Customization for GCI_3
- Simplify title
- Breadcrumbs
Index: loncom/interface/lonnavdisplay.pm
diff -u loncom/interface/lonnavdisplay.pm:1.13.6.2 loncom/interface/lonnavdisplay.pm:1.13.6.3
--- loncom/interface/lonnavdisplay.pm:1.13.6.2 Mon Oct 4 21:46:32 2010
+++ loncom/interface/lonnavdisplay.pm Mon Oct 4 21:51:22 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Navigate Maps Handler
#
-# $Id: lonnavdisplay.pm,v 1.13.6.2 2010/10/04 21:46:32 raeburn Exp $
+# $Id: lonnavdisplay.pm,v 1.13.6.3 2010/10/04 21:51:22 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -156,21 +156,27 @@
# Header
my $course_type = &Apache::loncommon::course_type();
my ($title,$breadcrumb_text,$start_page,$args);
- if ($course_type eq 'Community') {
- $title = 'Community Contents';
- $breadcrumb_text = &mt('Community Contents');
- } else {
- $title = 'Course Contents';
- $breadcrumb_text = &mt('Course Contents');
- }
+ $title = 'Contents';
+ $breadcrumb_text = &mt('Contents');
if ($env{'form.register'}) {
- $args = {'force_register' => $env{'form.register'},
- 'only_body' => $body_only};
+ $args = {'force_register' => $env{'form.register'}};
+ my $brcrum = [{href => '/adm/navmaps',
+ text => $breadcrumb_text,
+ no_mt => 1,},
+ ];
+ $args = {'bread_crumbs' => $brcrum,
+ 'only_body' => $body_only};
$start_page = &Apache::loncommon::start_page($title,$js,$args);
} else {
- my $brcrum = [{href => '/adm/navmaps',
- text => $breadcrumb_text,
- no_mt => 1},
+ my $nomenu = 0;
+ if ((&Apache::loncommon::needs_gci_custom()) ||
+ ($env{'user.domain'} eq 'gcitest' && $env{'request.course.id'})) {
+ $nomenu = 1;
+ }
+ my $brcrum = [{href => '/adm/navmaps',
+ text => $breadcrumb_text,
+ no_mt => 1,
+ _nomenu => $nomenu,},
];
$args = {'bread_crumbs' => $brcrum,
'only_body' => $body_only};
From raeburn@source.lon-capa.org Mon Oct 4 19:01:32 2010
From: raeburn@source.lon-capa.org (raeburn)
Date: Mon, 04 Oct 2010 18:01:32 -0000
Subject: [LON-CAPA-cvs] cvs: loncom(GCI_3) /interface loncommon.pm
Message-ID:
This is a MIME encoded message
--raeburn1286215292
Content-Type: text/plain
raeburn Mon Oct 4 18:01:32 2010 EDT
Modified files: (Branch: GCI_3)
/loncom/interface loncommon.pm
Log:
- Customization for GCI_3
- Backport 1.933
- &concept_test_manager() added to provide inline tertiary menu for Coordinator
role in Concept Tests.
- Additional styles (for , , for "Menu" page.
- LC_page_header style to provide white background for primary menu where
resource defines black background for .body.
- #LC_breadcrumbs has text-align: left; to flush breadcrumbs left where
resource defines text-align: center in .body.
- gctest_switcher() and gcitest_switcher_js() moved from lonmainmenu.pm to loncommon.pm
--raeburn1286215292
Content-Type: text/plain
Content-Disposition: attachment; filename="raeburn-20101004180132.txt"
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.925.2.13 loncom/interface/loncommon.pm:1.925.2.14
--- loncom/interface/loncommon.pm:1.925.2.13 Sun Sep 19 18:50:48 2010
+++ loncom/interface/loncommon.pm Mon Oct 4 18:01:31 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.925.2.13 2010/09/19 18:50:48 raeburn Exp $
+# $Id: loncommon.pm,v 1.925.2.14 2010/10/04 18:01:31 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -4559,8 +4559,7 @@
my $role_selector;
if (($custommenu) && ($env{'request.course.id'}) &&
- ($env{'course.'.$env{'request.course.id'}.'.domain'} eq 'gcitest') &&
- ($env{'request.role'} !~ m{^st\./gcitest/$match_courseid})) {
+ ($env{'course.'.$env{'request.course.id'}.'.domain'} eq 'gcitest')) {
$role_selector = &Apache::lonmenu::roles_selector(
$env{'course.' . $env{'request.course.id'} . '.domain'},
$env{'course.' . $env{'request.course.id'} . '.num'} );
@@ -4568,6 +4567,56 @@
$role_selector = ' '.$role_selector;
}
}
+ my $cid = $env{'request.course.id'};
+ my %gcicourses = (
+ gci_9615072b469884921gcil1 => 'review',
+ gci_1H96711d710194bfegcil1 => 'submit',
+ gci_5422913620b814c90gcil1 => 'tutorial',
+ );
+ if (($custommenu && $cid && !$gcicourses{$cid}) || ($env{'user.domain'} eq 'gcitest')) {
+ my $role = 'st';
+ if ($custommenu) {
+ $role = 'cc';
+ }
+ my ($switcher_js,$switcher,$formname);
+ $formname = 'pickrole';
+ my %courses = &existing_gcitest_courses($role);
+ my $numcourses = keys(%courses);
+ my $reqdcount = 0;
+ if ($cid) {
+ if ($courses{$cid}) {
+ $reqdcount = 1;
+ }
+ }
+ if ($numcourses > $reqdcount) {
+ $switcher = &gcitest_switcher($role,$formname,%courses);
+ my $current;
+ if ($cid) {
+ $current = $role.'./'.$env{'course.'.$cid.'.domain'}.
+ '/'.$env{'course.'.$cid.'.num'};
+ }
+ $switcher_js = &Apache::loncommon::gcitest_switcher_js($current,$numcourses,$formname);
+ if ($switcher_js) {
+ $switcher_js= <<"ENDSCRIPT";
+
+ENDSCRIPT
+ }
+ }
+ if ($switcher) {
+ $switcher = $switcher_js.$switcher;
+ if ($role_selector) {
+ $role_selector .= ' '.$switcher;
+ } else {
+ $role_selector .= ' '.$switcher;
+ }
+ }
+ }
if ($env{'request.noversionuri'} =~ m{^/res/adm/pages/}) {
if ($dc_info) {
@@ -4578,6 +4627,9 @@
return $bodytag;
}
+ if ($cid && $gcicourses{$cid} eq 'tutorial') {
+ $bodytag .= '';
+ }
#don't show menus for public users
if($env{'user.name'} ne 'public' && $env{'user.domain'} ne 'public'){
@@ -4605,6 +4660,17 @@
$args->{'bread_crumbs'});
} elsif ($forcereg) {
$bodytag .= &Apache::lonmenu::innerregister($forcereg);
+ } elsif ($custommenu && $env{'request.course.id'} &&
+ &Apache::lonnet::allowed('mdc', $env{'request.course.id'})) {
+ if ($env{'request.noversionuri'} eq '/adm/navmaps') {
+ my @advtools = &concept_test_manager();
+ &Apache::lonhtmlcommon::add_breadcrumb_tool(
+ 'advtools',@advtools);
+ my $advlinks;
+ my $legendtext = '';
+ &Apache::lonhtmlcommon::render_advtools(\$advlinks,$legendtext);
+ $bodytag .= $advlinks;
+ }
}
}else{
# this is to seperate menu from content when there's no secondary
@@ -4613,8 +4679,6 @@
$bodytag .= Apache::lonhtmlcommon::scripttag('', 'end');
}
- #SD testing
- #$bodytag .= Apache::lonmenu::menubuttons($forcereg);
return $bodytag;
}
@@ -4652,6 +4716,52 @@
ENDBODY
}
+sub concept_test_manager {
+ my @advtools;
+ my %items = (
+ docs => {
+ desc => 'Edit Test',
+ action => "go('/adm/coursedocs')",
+ tooltip => 'Assemble or modify Concept Test'
+ },
+ cprv => {
+ desc => 'Enrollment/Activity',
+ action => "go('/adm/createuser')",
+ tooltip => 'Enrollment and student activity',
+ },
+ new => {
+ desc => "What's New?",
+ action => "go('/adm/whatsnew')",
+ tooltip => 'Recent events/action items in Concept Test' ,
+ },
+ prnt => {
+ desc => 'Print Test',
+ action => "go('/adm/printout');",
+ tooltip => 'Prepare printable Concept Test',
+ },
+ chrt => {
+ desc => 'Test Statistics',
+ action => "go('/adm/statistics');",
+ tooltip => 'Concept Test Statistics',
+ },
+ rcrs => {
+ desc => 'Create New Test',
+ action => "switchpage('createtest');",
+ tooltip => 'Create new Concept Test',
+ },
+ );
+ my @ordered = ('docs','cprv','new','prnt','chrt','rcrs');
+ foreach my $item (@ordered) {
+ push(@advtools,
+ '');
+ }
+ return @advtools;
+}
+
sub dc_courseid_toggle {
my ($dc_info) = @_;
return ' '.
@@ -4954,6 +5064,47 @@
margin: 0;
}
+ul.LC_breadcrumb_tools_outerlist {
+ margin: 0;
+ padding: 0;
+ position: relative;
+ list-style: none;
+}
+ul.LC_breadcrumb_tools_outerlist li {
+ display: inline;
+}
+
+.LC_breadcrumb_tools_navigation {
+ padding: 0;
+ margin: 0;
+ float: left;
+}
+.LC_breadcrumb_tools_tools {
+ padding: 0;
+ margin: 0;
+ float: right;
+}
+
+div.LC_GCI_Menu {
+ width:900px;
+}
+
+div.LC_GCI_Menu:after {
+ content:'';
+ display:block;
+ clear:both;
+}
+
+div.LC_GCI_Menu_left {
+ float:left;
+ width:400px;
+}
+
+div.LC_GCI_Menu_right {
+ float:left;
+ width:400px;;
+}
+
dl.LC_GCI_Menu {
width:300px;
float:left;
@@ -4966,6 +5117,10 @@
margin-bottom:0.7em;
}
+dl.LC_GCI_Menu dt a {
+ color: $font;
+}
+
dl.LC_GCI_Menu dd {
font-size:0.8em;
margin:0 0 2em 0;
@@ -4974,47 +5129,6 @@
background:none no-repeat left top;
}
-/* #SD START (work in progress)*/
-
-ul.LC_bct {
- margin: 0;
- padding: 0;
-}
-ul.LC_bct ol {
- display: inline;
-}
-ul.LC_bct ul {
- display: inline;
- padding: 0;
-}
-ul.LC_bct li {
- list-style-type: none;
- display: inline;
-}
-
-
-ul.LC_breadcrumb_tools {
-}
-
-li.LC_breadcrumb_tools {
-}
-li.LC_breadcrumb_tools img{
- vertical-align: middle;
-}
-
-.LC_breadcrumb_tools_A {
- margin: 0 0 0 1em;
-}
-.LC_breadcrumb_tools_B {
- float: right;
- margin-top: 0.4em;
-}
-.LC_breadcrumb_tools_C {
- margin: 0 1em 0 0;
- float: right;
-}
-/* #SD END */
-
table#LC_title_bar td {
background: $tabbg;
}
@@ -5025,7 +5139,7 @@
.LC_breadcrumbs_component {
float: right;
- margin: 0 1em;
+ margin: 0.25em 1em;
}
.LC_breadcrumbs_component img {
vertical-align: middle;
@@ -5044,11 +5158,10 @@
background: $sidebg;
border-bottom: 1px solid $lg_border_color;
line-height: 2.5em;
- /* SD working here
- height: 2.5em;
- overflow: hidden; */
+ overflow: hidden;
margin: 0;
padding: 0;
+ text-align: left;
}
/* Preliminary fix to hide breadcrumbs inside remote control window */
@@ -5060,7 +5173,7 @@
clear:both;
background: #F8F8F8; /* $sidebg; */
border: 1px solid $sidebg;
- margin: 0 0 10px 0;
+ margin: 0 0 0 0;
}
.LC_fontsize_medium {
@@ -6018,6 +6131,11 @@
padding: 0 5px 0 5px;
}
+div.LC_page_header {
+ background-color: $pgbg_or_bgcolor;
+ margin: 0 0 1.0em 0;
+}
+
#LC_nav_bar {
float: left;
margin: 0.2em 0 0 0;
@@ -6193,18 +6311,15 @@
ol#LC_PathBreadcrumbs {
padding-left: 10px;
margin: 0;
- list-style-position: inside;
- /* SD working here
- white-space: nowrap; */
+ margin: 0;
+ height: 2.5em; /* equal to #LC_breadcrumbs line-height */
}
ol#LC_MenuBreadcrumbs li,
ol#LC_PathBreadcrumbs li,
ul.LC_CourseBreadcrumbs li {
display: inline;
- white-space: nowrap;
- /* SD working here
- white-space: normal; */
+ white-space: normal;
}
ol#LC_MenuBreadcrumbs li a,
@@ -6213,6 +6328,14 @@
font-size:90%;
}
+ol#LC_MenuBreadcrumbs h1 {
+ display: inline;
+ font-size: 90%;
+ line-height: 2.5em;
+ margin: 0;
+ padding: 0;
+}
+
ol#LC_PathBreadcrumbs li a {
text-decoration:none;
font-size:100%;
@@ -6457,6 +6580,11 @@
padding: 0.5em 1em 0.5em 0;
}
+ul.LC_funclist > li:first-child {
+ font-weight:bold;
+ margin-left:0.8em;
+}
+
ul.LC_funclist + ul.LC_funclist {
/*
left border as a seperator if we have more than
@@ -6483,10 +6611,11 @@
background:#DAE0D2 url("/gcimenu_bg.gif") repeat-x bottom;
font-size:93%;
line-height:normal;
+ margin: 0.5em 0 0.5em 0;
}
#gciheader ul {
margin:0;
- padding:10px 10px 0;
+ padding:10px 5px 0;
list-style:none;
}
#gciheader li {
@@ -6801,8 +6930,8 @@
#if bread_crumbs_component exists show it as headline else show only the breadcrumbs
if(exists($args->{'bread_crumbs_component'})){
$result .= &Apache::lonhtmlcommon::breadcrumbs($args->{'bread_crumbs_component'});
- }else{
- $result .= &Apache::lonhtmlcommon::breadcrumbs();
+ } else {
+ $result .= &Apache::lonhtmlcommon::breadcrumbs();
}
}
return $result;
@@ -10909,6 +11038,81 @@
return %courses;
}
+sub gcitest_switcher {
+ my ($role,$formname,%courses) = @_;
+ my $output;
+ my %Sortby;
+ foreach my $course (sort(keys(%courses))) {
+ next unless (ref($courses{$course}) eq 'HASH');
+ my $clean_title = $courses{$course}{'description'};
+ $clean_title =~ s/\W+//g;
+ if ($clean_title eq '') {
+ $clean_title = $courses{$course}{'description'};
+ }
+ push(@{$Sortby{$clean_title}},$course);
+ }
+ my @sorted_courses = sort { lc($a) cmp lc($b) } (keys(%Sortby));
+ my $default;
+ if (@sorted_courses > 1) {
+ if (($env{'request.course.id'}) && ($courses{$env{'request.course.id'}})) {
+ $default = &mt('Switch concept test ...');
+ } else {
+ $default = &mt('Select a concept test ...');
+ }
+ } else {
+ unless (($env{'request.course.id'}) && ($courses{$env{'request.course.id'}})) {
+ $default = &mt('Select concept test ...');
+ }
+ }
+ if ($default) {
+ $output = ''.
+ ''.
+ ''.$default.' ';
+ foreach my $item (@sorted_courses) {
+ foreach my $course (@{$Sortby{$item}}) {
+ my ($cdom,$cnum) = split('_',$course);
+ $output .= ''.$courses{$course}{'description'}.' ';
+ }
+ }
+ $output .= ' ';
+ }
+ return $output;
+}
+
+sub gcitest_switcher_js {
+ my ($current,$numcourses,$formname) = @_;
+ my $output = <<"ENDJS";
+
+function courseswitcher(caller) {
+ var numcourses = $numcourses;
+ var current = '$current';
+ var choice = document.$formname.newrole.options[document.$formname.newrole.selectedIndex].value;
+ if (choice == '') {
+ if (caller == 'icon') {
+ alert('No Concept Test selected');
+ }
+ document.$formname.selectrole.value = '';
+ return;
+ }
+ if (choice == current) {
+ if ((caller != 'icon') && (numcourses > 1)) {
+ alert('You have selected the current course.\\nPlease select a different Concept Test course');
+ }
+ document.$formname.newrole.selectedIndex = 0;
+ document.$formname.selectrole.value = '';
+ return;
+ }
+ document.$formname.selectrole.value = '1';
+ document.$formname.submit();
+ return;
+}
+
+ENDJS
+ return $output;
+}
+
+
+
=pod
=back
--raeburn1286215292--
From raeburn@source.lon-capa.org Mon Oct 4 16:07:17 2010
From: raeburn@source.lon-capa.org (raeburn)
Date: Mon, 04 Oct 2010 15:07:17 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /build CHECKRPMS
Message-ID:
raeburn Mon Oct 4 15:07:17 2010 EDT
Modified files:
/loncom/build CHECKRPMS
Log:
- Change in regexp for Scientific Linux to match change in distprobe rev 1.17
- credit: E. Ramirez.
Index: loncom/build/CHECKRPMS
diff -u loncom/build/CHECKRPMS:1.11 loncom/build/CHECKRPMS:1.12
--- loncom/build/CHECKRPMS:1.11 Tue Jul 14 14:36:06 2009
+++ loncom/build/CHECKRPMS Mon Oct 4 15:07:17 2010
@@ -122,7 +122,7 @@
$cmd = 'yum update';
&prepare_msg($tmpfile,$cmd);
($send,$addsubj) = &check_with_yum($tmpfile);
-} elsif ($distro =~ /^scientific\d+\.\d$/) {
+} elsif ($distro =~ /^scientific\d+$/) {
$cmd = 'yum update';
&prepare_msg($tmpfile,$cmd);
($send,$addsubj) = &check_with_yum($tmpfile);
From raeburn@source.lon-capa.org Mon Oct 4 19:54:46 2010
From: raeburn@source.lon-capa.org (raeburn)
Date: Mon, 04 Oct 2010 18:54:46 -0000
Subject: [LON-CAPA-cvs] cvs: loncom(GCI_3) /interface lonmainmenu.pm
Message-ID:
raeburn Mon Oct 4 18:54:46 2010 EDT
Modified files: (Branch: GCI_3)
/loncom/interface lonmainmenu.pm
Log:
- Customization for GCI_3
- gctest_switcher() and gcitest_switcher_js() moved from lonmainmenu.pm to loncommon.pm
- /adm/menu redirects to Contents page for Inventory, Submission and Tutorial courses
and for non-CC roles in Concept Tests.
Index: loncom/interface/lonmainmenu.pm
diff -u loncom/interface/lonmainmenu.pm:1.8.4.7 loncom/interface/lonmainmenu.pm:1.8.4.8
--- loncom/interface/lonmainmenu.pm:1.8.4.7 Fri Jan 15 04:12:54 2010
+++ loncom/interface/lonmainmenu.pm Mon Oct 4 18:54:46 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# displays the main menu
#
-# $Id: lonmainmenu.pm,v 1.8.4.7 2010/01/15 04:12:54 raeburn Exp $
+# $Id: lonmainmenu.pm,v 1.8.4.8 2010/10/04 18:54:46 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -53,13 +53,25 @@
$r->send_http_header;
return OK if $r->header_only;
- my $form;
+ my $custommenu = &Apache::loncommon::needs_gci_custom();
+ my $cid = $env{'request.course.id'};
+ my %gcicourses = (
+ gci_9615072b469884921gcil1 => 'review',
+ gci_1H96711d710194bfegcil1 => 'submit',
+ gci_5422913620b814c90gcil1 => 'tutorial',
+ );
+ if (($custommenu && $cid ne '' && ($gcicourses{$cid} || $env{'request.role'} !~ m{^cc\./gcitest/})) ||
+ ($env{'user.domain'} eq 'gcitest')) {
+ $r->internal_redirect('/adm/navmaps');
+ return OK;
+ }
+
+ my $form;
if ($env{'environment.remote'} ne 'off') {
$form=&Apache::lonmenu::serverform();
}
- my $custommenu = &Apache::loncommon::needs_gci_custom();
- my ($script_tag,$switcher);
+ my $script_tag;
if ($env{'environment.remote'} ne 'off') {
my $utility=&Apache::lonmenu::utilityfunctions('/adm/menu');
$script_tag=(<
ENDSCRIPT
- } elsif (($custommenu) || ($env{'user.domain'} eq 'gcitest')) {
- my $role = 'st';
- if ($custommenu) {
- $role = 'cc';
- }
- my $switcher_js;
- my %courses = &Apache::loncommon::existing_gcitest_courses($role);
- my $numcourses = keys(%courses);
- if ($numcourses > 0) {
- $switcher = &gcitest_switcher($role,%courses);
- my $current;
- if ($env{'request.course.id'}) {
- $current = $role.'./'.$env{'course.'.$env{'request.course.id'}.'.domain'}.
- '/'.$env{'course.'.$env{'request.course.id'}.'.num'};
- }
- $switcher_js = &gcitest_switcher_js($current,$numcourses);
- $script_tag= <<"ENDSCRIPT";
-
-ENDSCRIPT
- }
}
# ---- Print the screen, pretend to be in text mode to generate text-based menu
# temporarily set interface to "faketextual" and remote to "off", which renders
@@ -100,10 +86,15 @@
$env{'browser.interface'}='faketextual';
$env{'environment.remote'}='off';
- $r->print(&Apache::loncommon::start_page( 'Main Menu',
- $script_tag,
- {'bread_crumbs' => 1}));
- my $rolecount = 0;
+ # Breadcrumbs
+ my $args;
+ unless ($custommenu && !$env{'request.course.id'}) {
+ my $brcrum = [];
+ $args = {bread_crumbs => $brcrum};
+ }
+ $r->print(&Apache::loncommon::start_page('Main Menu',$script_tag,$args));
+
+ my ($rolecount,$numcourses) = (0,0);
unless (($custommenu) || ($env{'user.domain'} eq 'gcitest')) {
foreach my $envkey (keys(%env)) {
next unless ($envkey =~ /^user\.role\./);
@@ -111,9 +102,7 @@
}
}
if ($custommenu) {
- $r->print(&Apache::lonmenu::inlinemenu('gcicustom',$switcher).$form);
- } elsif ($env{'user.domain'} eq 'gcitest') {
- $r->print(&Apache::lonmenu::inlinemenu('gcistudent',$switcher).$form);
+ $r->print(&Apache::lonmenu::inlinemenu('gcicustom').$form);
} elsif (!$rolecount) {
$r->print(&Apache::lonmenu::inlinemenu('gcinorole').$form);
} else {
@@ -123,79 +112,6 @@
return OK;
}
-sub gcitest_switcher {
- my ($role,%courses) = @_;
- my $output;
- my %Sortby;
- foreach my $course (sort(keys(%courses))) {
- next unless (ref($courses{$course}) eq 'HASH');
- my $clean_title = $courses{$course}{'description'};
- $clean_title =~ s/\W+//g;
- if ($clean_title eq '') {
- $clean_title = $courses{$course}{'description'};
- }
- push(@{$Sortby{$clean_title}},$course);
- }
- my @sorted_courses = sort { lc($a) cmp lc($b) } (keys(%Sortby));
- my $default;
- if (@sorted_courses > 1) {
- if (($env{'request.course.id'}) && ($courses{$env{'request.course.id'}})) {
- $default = &mt('Switch concept test ...');
- } else {
- $default = &mt('Select a concept test ...');
- }
- } else {
- unless (($env{'request.course.id'}) && ($courses{$env{'request.course.id'}})) {
- $default = &mt('Select concept test ...');
- }
- }
- if ($default) {
- $output = ''.
- ''.
- ''.$default.' ';
- foreach my $item (@sorted_courses) {
- foreach my $course (@{$Sortby{$item}}) {
- my ($cdom,$cnum) = split('_',$course);
- $output .= ''.$courses{$course}{'description'}.' ';
- }
- }
- $output .= ' ';
- }
- return $output;
-}
-
-sub gcitest_switcher_js {
- my ($current,$numcourses) = @_;
- my $output = <<"ENDJS";
-
-function courseswitcher(caller) {
- var numcourses = $numcourses;
- var current = '$current';
- var choice = document.pickrole.newrole.options[document.pickrole.newrole.selectedIndex].value;
- if (choice == '') {
- if (caller == 'icon') {
- alert('No Concept Test selected');
- }
- document.pickrole.selectrole.value = '';
- return;
- }
- if (choice == current) {
- if ((caller != 'icon') && (numcourses > 1)) {
- alert('You have selected the current course.\\nPlease select a different Concept Test course');
- }
- document.pickrole.newrole.selectedIndex = 0;
- document.pickrole.selectrole.value = '';
- return;
- }
- document.pickrole.selectrole.value = '1';
- document.pickrole.submit();
- return;
-}
-
-ENDJS
- return $output;
-}
-
1;
__END__
From raeburn@source.lon-capa.org Mon Oct 4 22:46:33 2010
From: raeburn@source.lon-capa.org (raeburn)
Date: Mon, 04 Oct 2010 21:46:33 -0000
Subject: [LON-CAPA-cvs] cvs: loncom(GCI_3) /interface lonnavdisplay.pm
Message-ID:
raeburn Mon Oct 4 21:46:33 2010 EDT
Modified files: (Branch: GCI_3)
/loncom/interface lonnavdisplay.pm
Log:
- Customization for GCI_3
- Corrections to backport of 1.17 in 1.13.6.1.
Index: loncom/interface/lonnavdisplay.pm
diff -u loncom/interface/lonnavdisplay.pm:1.13.6.1 loncom/interface/lonnavdisplay.pm:1.13.6.2
--- loncom/interface/lonnavdisplay.pm:1.13.6.1 Mon Oct 4 21:27:20 2010
+++ loncom/interface/lonnavdisplay.pm Mon Oct 4 21:46:32 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Navigate Maps Handler
#
-# $Id: lonnavdisplay.pm,v 1.13.6.1 2010/10/04 21:27:20 raeburn Exp $
+# $Id: lonnavdisplay.pm,v 1.13.6.2 2010/10/04 21:46:32 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -155,7 +155,7 @@
# Header
my $course_type = &Apache::loncommon::course_type();
- my ($title,$breadcrumb_text);
+ my ($title,$breadcrumb_text,$start_page,$args);
if ($course_type eq 'Community') {
$title = 'Community Contents';
$breadcrumb_text = &mt('Community Contents');
@@ -176,7 +176,8 @@
'only_body' => $body_only};
$start_page = &Apache::loncommon::start_page($title,$js,$args);
}
- $r->print('');
+ $r->print($start_page.
+ '');
$r->rflush();
@@ -309,9 +310,12 @@
$env{'form.condition'} = 1;
$resource_no_folder_link = 1;
} else {
+ my $link = 'navmaps?sort='.$env{'form.sort'}.'&showOnlyHomework=1';
+ if ($env{'form.register'}) {
+ $link .= '®ister='.$env{'form.register'};
+ }
&Apache::lonnavmaps::add_linkitem(\%toplinkitems,'uncompleted',
- 'location.href="navmaps?sort='.$env{'form.sort'}.
- '&showOnlyHomework=1"',
+ 'location.href="'.$link.'"',
"Show only uncompleted problems");
}
@@ -321,8 +325,8 @@
'.&mt('Sort by:').'
- '.&mt('Default').'
- ".&mt('Title').'
+ '.&mt('Default').'
+ '.&mt('Title').'
'.&mt('Duedate').'
'.&mt('Has New Discussion').'
From www@source.lon-capa.org Tue Oct 5 01:10:07 2010
From: www@source.lon-capa.org (www)
Date: Tue, 05 Oct 2010 00:10:07 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /homework functionplotresponse.pm
Message-ID:
www Tue Oct 5 00:10:07 2010 EDT
Modified files:
/loncom/homework functionplotresponse.pm
Log:
-tag
Index: loncom/homework/functionplotresponse.pm
diff -u loncom/homework/functionplotresponse.pm:1.5 loncom/homework/functionplotresponse.pm:1.6
--- loncom/homework/functionplotresponse.pm:1.5 Mon Oct 4 20:47:29 2010
+++ loncom/homework/functionplotresponse.pm Tue Oct 5 00:10:07 2010
@@ -1,7 +1,7 @@
# LearningOnline Network with CAPA
# option list style responses
#
-# $Id: functionplotresponse.pm,v 1.5 2010/10/04 20:47:29 www Exp $
+# $Id: functionplotresponse.pm,v 1.6 2010/10/05 00:10:07 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -33,7 +33,7 @@
use Apache::lonnet;
BEGIN {
- &Apache::lonxml::register('Apache::functionplotresponse',('functionplotresponse','backgroundplot'));
+ &Apache::lonxml::register('Apache::functionplotresponse',('functionplotresponse','backgroundplot','spline'));
}
#
@@ -139,7 +139,27 @@
sub update_register {
my ($id,$variable)=@_;
- return "document.ggbApplet_$id.registerObjectUpdateListener('$variable','updatePointCoordinates_$id')";
+ return "document.ggbApplet_$id.registerObjectUpdateListener('$variable','updatePointCoordinates_$id');\n";
+}
+
+#
+# Set a coordinate variable
+#
+sub set_coordinate {
+ my ($id,$variable,$x,$y)=@_;
+ return (<
+# Subroutine that generates spline $label based on stored information
+#
+
+sub generate_spline {
+ my ($id,$label)=@_;
+ my $result='';
+ return $result;
+}
+#
+#
#
sub start_backgroundplot {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
my $result='';
my $internalid = $Apache::inputtags::part.'_'.$Apache::inputtags::response[-1];
my $function=&Apache::lonxml::get_param('function',$parstack,$safeeval);
+ my $fixed=(&Apache::lonxml::get_param('fixed',$parstack,$safeeval)=~/on|true|yes|1/i?1:0);
+
unless ($function) { $function="0"; }
if ($target eq 'web') {
- $result.=&plot_script($internalid,$function);
+ $result.=&plot_script($internalid,$function,$fixed);
}
return $result;
}
sub end_backgroundplot {
+ return '';
+}
+
+#
+#
+#
+# Unfortunately, GeoGebra seems to want all splines after everything else, so we need to store them
+#
+sub start_spline {
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
+ my $label=&Apache::lonxml::get_param('label',$parstack,$safeeval);
+ $Apache::functionplotresponse::counter++;
+ unless ($label) { $label='S'.$Apache::functionplotresponse::counter; }
+
+ my $order=&Apache::lonxml::get_param('order',$parstack,$safeeval);
+ if (($order<2) || ($order>4)) { $order=2; }
+ $Apache::functionplotresponse::splineorder{$label}=$order;
+
+ my $x=&Apache::lonxml::get_param('initx',$parstack,$safeeval);
+ unless ($x) { $x=0; }
+ $Apache::functionplotresponse::splineinitx{$label}=$x;
+
+ my $y=&Apache::lonxml::get_param('inity',$parstack,$safeeval);
+ unless ($y) { $y=0; }
+ $Apache::functionplotresponse::splineinity{$label}=$y;
+
+ my $sx=&Apache::lonxml::get_param('scalex',$parstack,$safeeval);
+ unless ($sx) { $sx=$order; }
+ $Apache::functionplotresponse::splinescalex{$label}=$sx;
+
+ my $sy=&Apache::lonxml::get_param('scaley',$parstack,$safeeval);
+ unless ($sy) { $sy=2; }
+ $Apache::functionplotresponse::splinescaley{$label}=$sy;
+}
+
+sub end_spline {
+ return '';
}
sub end_init_script {
@@ -214,7 +290,16 @@
sub start_functionplotresponse {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
my $result='';
+# To remember the splines - somehow, they need to come last
+ undef %Apache::functionplotresponse::splineorder;
+ undef %Apache::functionplotresponse::splineinitx;
+ undef %Apache::functionplotresponse::splineinity;
+ undef %Apache::functionplotresponse::splinescalex;
+ undef %Apache::functionplotresponse::splinescaley;
+ $Apache::functionplotresponse::counter=0;
+# Internal ID to mark the applet and its coordinates
my $internalid = $Apache::inputtags::part.'_'.&Apache::response::start_response($parstack,$safeeval);
+# Parameters of
my $xmin=&Apache::lonxml::get_param('xmin',$parstack,$safeeval);
$xmin=($xmin?$xmin:-10);
my $xmax=&Apache::lonxml::get_param('xmax',$parstack,$safeeval);
@@ -223,9 +308,9 @@
$ymin=($ymin?$ymin:-10);
my $ymax=&Apache::lonxml::get_param('ymax',$parstack,$safeeval);
$ymax=($ymax?$ymax:10);
- my $xaxisvisible=(&Apache::lonxml::get_param('xaxisvisible',$parstack,$safeeval)=~/on|true|1/i?'true':'false');
- my $yaxisvisible=(&Apache::lonxml::get_param('yaxisvisible',$parstack,$safeeval)=~/on|true|1/i?'true':'false');
- my $gridvisible=(&Apache::lonxml::get_param('gridvisible',$parstack,$safeeval)=~/on|true|1/i?'true':'false');
+ my $xaxisvisible=(&Apache::lonxml::get_param('xaxisvisible',$parstack,$safeeval)=~/on|true|yes|1/i?'true':'false');
+ my $yaxisvisible=(&Apache::lonxml::get_param('yaxisvisible',$parstack,$safeeval)=~/on|true|yes|1/i?'true':'false');
+ my $gridvisible=(&Apache::lonxml::get_param('gridvisible',$parstack,$safeeval)=~/on|true|yes|1/i?'true':'false');
if ($target eq 'web') {
# paste in the update routine to receive stuff back from the applet
@@ -248,6 +333,10 @@
# if ($target eq 'edit') { $result=&Apache::edit::end_table(); }
if ($target eq 'web') {
+# Now is the time to render all of the stored splines
+ foreach my $label (keys(%Apache::functionplotresponse::splineorder)) {
+ $result.=&generate_spline($internalid,$label);
+ }
# close the init script
$result.=&end_init_script();
# actually start the -tag
From www@source.lon-capa.org Mon Oct 4 20:26:39 2010
From: www@source.lon-capa.org (www)
Date: Mon, 04 Oct 2010 19:26:39 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /homework functionplotresponse.pm
Message-ID:
www Mon Oct 4 19:26:39 2010 EDT
Modified files:
/loncom/homework functionplotresponse.pm
Log:
Axes parameters and background plots
Index: loncom/homework/functionplotresponse.pm
diff -u loncom/homework/functionplotresponse.pm:1.3 loncom/homework/functionplotresponse.pm:1.4
--- loncom/homework/functionplotresponse.pm:1.3 Mon Oct 4 18:28:53 2010
+++ loncom/homework/functionplotresponse.pm Mon Oct 4 19:26:39 2010
@@ -1,7 +1,7 @@
# LearningOnline Network with CAPA
# option list style responses
#
-# $Id: functionplotresponse.pm,v 1.3 2010/10/04 18:28:53 www Exp $
+# $Id: functionplotresponse.pm,v 1.4 2010/10/04 19:26:39 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -33,7 +33,7 @@
use Apache::lonnet;
BEGIN {
- &Apache::lonxml::register('Apache::functionplotresponse',('functionplotresponse'));
+ &Apache::lonxml::register('Apache::functionplotresponse',('functionplotresponse','backgroundplot'));
}
sub geogebra_startcode {
@@ -103,10 +103,44 @@
'."\n";
my %breadcrumb_text = &singleuser_breadcrumb($crstype);
- my $args;
- if ($env{'form.popup'}) {
- $args->{'no_nav_bar'} = 1;
- } else {
- $args = undef;
- }
- $r->print(&Apache::loncommon::start_page($title,$jscript,$args));
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>"javascript:backPage(document.userupdate)",
- text=>$breadcrumb_text{'search'},
- faq=>282,bug=>'Instructor Interface',});
+ push (@{$brcrum},
+ {href => "javascript:backPage(document.userupdate)",
+ text => $breadcrumb_text{'search'},
+ faq => 282,
+ bug => 'Instructor Interface',}
+ );
if ($env{'form.prevphase'} eq 'userpicked') {
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>"javascript:backPage(document.userupdate,'get_user_info','select')",
- text=>$breadcrumb_text{'userpicked'},
- faq=>282,bug=>'Instructor Interface',});
- }
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>"javascript:backPage(document.userupdate,'$env{'form.prevphase'}','modify')",
- text=>$breadcrumb_text{'modify'},
- faq=>282,bug=>'Instructor Interface',},
- {href=>"/adm/createuser",
- text=>"Result",
- faq=>282,bug=>'Instructor Interface',});
+ push(@{$brcrum},
+ {href => "javascript:backPage(document.userupdate,'get_user_info','select')",
+ text => $breadcrumb_text{'userpicked'},
+ faq => 282,
+ bug => 'Instructor Interface',});
+ }
my $helpitem = 'Course_Change_Privileges';
if ($env{'form.action'} eq 'singlestudent') {
$helpitem = 'Course_Add_Student';
}
- $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management',
- $helpitem));
+ push(@{$brcrum},
+ {href => "javascript:backPage(document.userupdate,'$env{'form.prevphase'}','modify')",
+ text => $breadcrumb_text{'modify'},
+ faq => 282,
+ bug => 'Instructor Interface',},
+ {href => "/adm/createuser",
+ text => "Result",
+ faq => 282,
+ bug => 'Instructor Interface',
+ help => $helpitem});
+ my $args = {bread_crumbs => $brcrum,
+ bread_crumbs_component => 'User Management'};
+ if ($env{'form.popup'}) {
+ $args->{'no_nav_bar'} = 1;
+ }
+ $r->print(&Apache::loncommon::start_page($title,$jscript,$args));
$r->print(&update_result_form($uhome));
# Check Inputs
if (! $env{'form.ccuname'} ) {
@@ -2884,7 +2896,6 @@
.&mt('Create/Modify Another User').' ');
}
}
- $r->print(&Apache::loncommon::end_page());
}
sub display_userinfo {
@@ -3624,7 +3635,7 @@
# ========================================================== Custom Role Editor
sub custom_role_editor {
- my ($r) = @_;
+ my ($r,$brcrum) = @_;
my $action = $env{'form.customroleaction'};
my $rolename;
if ($action eq 'new') {
@@ -3633,11 +3644,6 @@
$rolename=$env{'form.rolename'};
}
- $rolename=~s/[^A-Za-z0-9]//gs;
- if (!$rolename || $env{'form.phase'} eq 'pickrole') {
- &print_username_entry_form($r);
- return;
- }
my ($crstype,$context);
if ($env{'request.course.id'}) {
$crstype = &Apache::loncommon::course_type();
@@ -3646,6 +3652,13 @@
$context = 'domain';
$crstype = $env{'form.templatecrstype'};
}
+
+ $rolename=~s/[^A-Za-z0-9]//gs;
+ if (!$rolename || $env{'form.phase'} eq 'pickrole') {
+ &print_username_entry_form($r,undef,undef,undef,undef,$crstype,$brcrum);
+ return;
+ }
+
# ------------------------------------------------------- What can be assigned?
my %full=();
my %courselevel=();
@@ -3753,25 +3766,28 @@
$head_script .= "\n".$jsback."\n"
.'// ]]>'."\n"
.''."\n";
- $r->print(&Apache::loncommon::start_page('Custom Role Editor',$head_script));
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>"javascript:backPage(document.form1,'pickrole','')",
- text=>"Pick custom role",
- faq=>282,bug=>'Instructor Interface',},
- {href=>"javascript:backPage(document.form1,'','')",
- text=>"Edit custom role",
- faq=>282,bug=>'Instructor Interface',});
- $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management',
- 'Course_Editing_Custom_Roles'));
-
- $r->print($body_top);
+ push (@{$brcrum},
+ {href => "javascript:backPage(document.form1,'pickrole','')",
+ text => "Pick custom role",
+ faq => 282,bug=>'Instructor Interface',},
+ {href => "javascript:backPage(document.form1,'','')",
+ text => "Edit custom role",
+ faq => 282,
+ bug => 'Instructor Interface',
+ help => 'Course_Editing_Custom_Roles'}
+ );
+ my $args = { bread_crumbs => $brcrum,
+ bread_crumbs_component => 'User Management'};
+
+ $r->print(&Apache::loncommon::start_page('Custom Role Editor',
+ $head_script,$args).
+ $body_top);
my %lt=&Apache::lonlocal::texthash(
'prv' => "Privilege",
'crl' => "Course Level",
'dml' => "Domain Level",
'ssl' => "System Level");
-
$r->print(''
.'
'
.''.&mt('Select a Template').' '
@@ -3822,8 +3838,7 @@
' '."\n".' '."\n".
' '."\n".
- ' '.
- &Apache::loncommon::end_page());
+ '
');
}
# --------------------------------------------------------
sub make_script_template {
@@ -3901,11 +3916,11 @@
}
# ---------------------------------------------------------- Call to definerole
sub set_custom_role {
- my ($r,$context) = @_;
+ my ($r,$context,$brcrum) = @_;
my $rolename=$env{'form.rolename'};
$rolename=~s/[^A-Za-z0-9]//gs;
if (!$rolename) {
- &custom_role_editor($r);
+ &custom_role_editor($r,$brcrum);
return;
}
my ($jsback,$elements) = &crumb_utilities();
@@ -3914,20 +3929,23 @@
.$jsback."\n"
.'// ]]>'."\n"
.''."\n";
-
- $r->print(&Apache::loncommon::start_page('Save Custom Role'),$jscript);
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>"javascript:backPage(document.customresult,'pickrole','')",
- text=>"Pick custom role",
- faq=>282,bug=>'Instructor Interface',},
- {href=>"javascript:backPage(document.customresult,'selected_custom_edit','')",
- text=>"Edit custom role",
- faq=>282,bug=>'Instructor Interface',},
- {href=>"javascript:backPage(document.customresult,'set_custom_roles','')",
- text=>"Result",
- faq=>282,bug=>'Instructor Interface',});
- $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management',
- 'Course_Editing_Custom_Roles'));
+ my $brcrum = [{href => "javascript:backPage(document.customresult,'pickrole','')",
+ text => "Pick custom role",
+ faq => 282,
+ bug => 'Instructor Interface',},
+ {href => "javascript:backPage(document.customresult,'selected_custom_edit','')",
+ text => "Edit custom role",
+ faq => 282,
+ bug => 'Instructor Interface',},
+ {href => "javascript:backPage(document.customresult,'set_custom_roles','')",
+ text => "Result",
+ faq => 282,
+ bug => 'Instructor Interface',
+ help => 'Course_Editing_Custom_Roles'},
+ ];
+ my $args = { bread_crumbs => $brcrum,
+ bread_crumbs_component => 'User Management'};
+ $r->print(&Apache::loncommon::start_page('Save Custom Role',$jscript,$args));
my ($rdummy,$roledef)=
&Apache::lonnet::get('roles',["rolesdef_$rolename"]);
@@ -3984,7 +4002,6 @@
}
$r->print('
'.&mt('Create or edit another custom role').'
');
$r->print(&Apache::lonhtmlcommon::echo_form_input([]).' ');
- $r->print(&Apache::loncommon::end_page());
}
# ================================================================ Main Handler
@@ -4008,11 +4025,14 @@
['action','state','callingform','roletype','showrole','bulkaction','popup','phase',
'username','domain','srchterm','srchdomain','srchin','srchby','srchtype']);
&Apache::lonhtmlcommon::clear_breadcrumbs();
+ my $args;
+ my $brcrum = [];
+ my $bread_crumbs_component = 'User Management';
if ($env{'form.action'} ne 'dateselect') {
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>"/adm/createuser",
- text=>"User Management",
- help=>'Course_Create_Class_List,Course_Change_Privileges,Course_View_Class_List,Course_Editing_Custom_Roles,Course_Add_Student,Course_Drop_Student,Course_Automated_Enrollment,Course_Self_Enrollment,Course_Manage_Group'});
+ $brcrum = [{href=>"/adm/createuser",
+ text=>"User Management",
+ help=>'Course_Create_Class_List,Course_Change_Privileges,Course_View_Class_List,Course_Editing_Custom_Roles,Course_Add_Student,Course_Drop_Student,Course_Automated_Enrollment,Course_Self_Enrollment,Course_Manage_Group'}
+ ];
}
#SD Following files not added to help, because the corresponding .tex-files seem to
#be missing: Course_Approve_Selfenroll,Course_User_Logs,
@@ -4030,17 +4050,20 @@
# Main switch on form.action and form.state, as appropriate
if (! exists($env{'form.action'})) {
- $r->print(&header());
- $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management'));
+ $args = {bread_crumbs => $brcrum,
+ bread_crumbs_component => $bread_crumbs_component};
+ $r->print(&header(undef,$args));
$r->print(&print_main_menu($permission,$context,$crstype));
- $r->print(&Apache::loncommon::end_page());
} elsif ($env{'form.action'} eq 'upload' && $permission->{'cusr'}) {
- $r->print(&header());
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>'/adm/createuser?action=upload&state=',
- text=>"Upload Users List"});
- $r->print(&Apache::lonhtmlcommon::breadcrumbs('Upload Users List',
- 'Course_Create_Class_List'));
+ push(@{$brcrum},
+ { href => '/adm/createuser?action=upload&state=',
+ text => 'Upload Users List',
+ help => 'Course_Create_Class_List',
+ });
+ $bread_crumbs_component = 'Upload Users List';
+ $args = {bread_crumbs => $brcrum,
+ bread_crumbs_component => $bread_crumbs_component};
+ $r->print(&header(undef,$args));
$r->print('
'."\n");
@@ -4056,7 +4079,6 @@
} else {
&Apache::lonuserutils::print_first_users_upload_form($r,$context);
}
- $r->print(' '.&Apache::loncommon::end_page());
} elsif ((($env{'form.action'} eq 'singleuser') || ($env{'form.action'}
eq 'singlestudent')) && ($permission->{'cusr'})) {
my $phase = $env{'form.phase'};
@@ -4073,13 +4095,13 @@
if ($env{'form.srchterm'} !~ /^$match_username$/) {
my $response = &mt('You must specify a valid username. Only the following are allowed: letters numbers - . @');
$env{'form.phase'} = '';
- &print_username_entry_form($r,$context,$response,$srch,undef,$crstype);
+ &print_username_entry_form($r,$context,$response,$srch,undef,$crstype,$brcrum);
} else {
my $ccuname =&LONCAPA::clean_username($srch->{'srchterm'});
my $ccdomain=&LONCAPA::clean_domain($srch->{'srchdomain'});
&print_user_modification_page($r,$ccuname,$ccdomain,
$srch,$response,$context,
- $permission,$crstype);
+ $permission,$crstype,$brcrum);
}
} elsif ($env{'form.phase'} eq 'get_user_info') {
my ($currstate,$response,$forcenewuser,$results) =
@@ -4089,7 +4111,8 @@
}
if ($currstate eq 'select') {
&print_user_selection_page($r,$response,$srch,$results,
- \@search,$context,undef,$crstype);
+ \@search,$context,undef,$crstype,
+ $brcrum);
} elsif ($currstate eq 'modify') {
my ($ccuname,$ccdomain);
if (($srch->{'srchby'} eq 'uname') &&
@@ -4107,56 +4130,62 @@
}
&print_user_modification_page($r,$ccuname,$ccdomain,
$srch,$response,$context,
- $permission,$crstype);
+ $permission,$crstype,$brcrum);
} elsif ($currstate eq 'query') {
- &print_user_query_page($r,'createuser');
+ &print_user_query_page($r,'createuser',$brcrum);
} else {
$env{'form.phase'} = '';
&print_username_entry_form($r,$context,$response,$srch,
- $forcenewuser,$crstype);
+ $forcenewuser,$crstype,$brcrum);
}
} elsif ($env{'form.phase'} eq 'userpicked') {
my $ccuname = &LONCAPA::clean_username($env{'form.seluname'});
my $ccdomain = &LONCAPA::clean_domain($env{'form.seludom'});
&print_user_modification_page($r,$ccuname,$ccdomain,$srch,'',
- $context,$permission,$crstype);
+ $context,$permission,$crstype,
+ $brcrum);
}
} elsif ($env{'form.phase'} eq 'update_user_data') {
- &update_user_data($r,$context,$crstype);
+ &update_user_data($r,$context,$crstype,$brcrum);
} else {
- &print_username_entry_form($r,$context,undef,$srch,undef,$crstype);
+ &print_username_entry_form($r,$context,undef,$srch,undef,$crstype,
+ $brcrum);
}
} elsif ($env{'form.action'} eq 'custom' && $permission->{'custom'}) {
if ($env{'form.phase'} eq 'set_custom_roles') {
- &set_custom_role($r,$context);
+ &set_custom_role($r,$context,$brcrum);
} else {
- &custom_role_editor($r);
+ &custom_role_editor($r,$brcrum);
}
} elsif (($env{'form.action'} eq 'listusers') &&
($permission->{'view'} || $permission->{'cusr'})) {
if ($env{'form.phase'} eq 'bulkchange') {
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>'/adm/createuser?action=listusers',
- text=>"List Users"},
- {href=>"/adm/createuser",
- text=>"Result"});
+ push(@{$brcrum},
+ {href => '/adm/createuser?action=listusers',
+ text => "List Users"},
+ {href => "/adm/createuser",
+ text => "Result",
+ help => 'Course_View_Class_List'});
+ $bread_crumbs_component = 'Update Users';
+ $args = {bread_crumbs => $brcrum,
+ bread_crumbs_component => $bread_crumbs_component};
+ $r->print(&header(undef,$args));
my $setting = $env{'form.roletype'};
my $choice = $env{'form.bulkaction'};
- $r->print(&header());
- $r->print(&Apache::lonhtmlcommon::breadcrumbs("Update Users",
- 'Course_View_Class_List'));
if ($permission->{'cusr'}) {
&Apache::lonuserutils::update_user_list($r,$context,$setting,$choice,$crstype);
- $r->print(&Apache::loncommon::end_page());
} else {
$r->print(&mt('You are not authorized to make bulk changes to user roles'));
$r->print('
'.&mt('Display User Lists').' ');
- $r->print(&Apache::loncommon::end_page());
}
} else {
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>'/adm/createuser?action=listusers',
- text=>"List Users"});
+ push(@{$brcrum},
+ {href => '/adm/createuser?action=listusers',
+ text => "List Users",
+ help => 'Course_View_Class_List'});
+ $bread_crumbs_component = 'List Users';
+ $args = {bread_crumbs => $brcrum,
+ bread_crumbs_component => $bread_crumbs_component};
my ($cb_jscript,$jscript,$totcodes,$codetitles,$idlist,$idlist_titles);
my $formname = 'studentform';
if (($context eq 'domain') && (($env{'form.roletype'} eq 'course') ||
@@ -4180,127 +4209,128 @@
my $loadcode =
&Apache::lonuserutils::course_selector_loadcode($formname);
if ($loadcode ne '') {
- $r->print(&header($js,{'onload' => $loadcode,}));
- } else {
- $r->print(&header($js));
+ $args->{add_entries} = {onload => $loadcode};
}
+ $r->print(&header($js,$args));
} else {
- $r->print(&header(&add_script(&verify_user_display())));
+ $r->print(&header(&add_script(&verify_user_display()),$args));
}
- $r->print(&Apache::lonhtmlcommon::breadcrumbs("List Users",
- 'Course_View_Class_List'));
&Apache::lonuserutils::print_userlist($r,undef,$permission,$context,
$formname,$totcodes,$codetitles,$idlist,$idlist_titles);
- $r->print(&Apache::loncommon::end_page());
}
} elsif ($env{'form.action'} eq 'drop' && $permission->{'cusr'}) {
- $r->print(&header());
my $brtext;
if ($crstype eq 'Community') {
$brtext = 'Drop Members';
} else {
$brtext = 'Drop Students';
}
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>'/adm/createuser?action=drop',
- text=>$brtext});
+ push(@{$brcrum},
+ {href => '/adm/createuser?action=drop',
+ text => $brtext,
+ help => 'Course_Drop_Student'});
+ if ($env{'form.state'} eq 'done') {
+ push(@{$brcrum},
+ {href=>'/adm/createuser?action=drop',
+ text=>"Result"});
+ }
+ $bread_crumbs_component = $brtext;
+ $args = {bread_crumbs => $brcrum,
+ bread_crumbs_component => $bread_crumbs_component};
+ $r->print(&header(undef,$args));
if (!exists($env{'form.state'})) {
- $r->print(&Apache::lonhtmlcommon::breadcrumbs($brtext,
- 'Course_Drop_Student'));
-
&Apache::lonuserutils::print_drop_menu($r,$context,$permission,$crstype);
} elsif ($env{'form.state'} eq 'done') {
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>'/adm/createuser?action=drop',
- text=>"Result"});
- $r->print(&Apache::lonhtmlcommon::breadcrumbs($brtext,
- 'Course_Drop_Student'));
&Apache::lonuserutils::update_user_list($r,$context,undef,
$env{'form.action'});
}
- $r->print(&Apache::loncommon::end_page());
} elsif ($env{'form.action'} eq 'dateselect') {
if ($permission->{'cusr'}) {
- $r->print(&header(undef,undef,{'no_nav_bar' => 1}).
+ $r->print(&header(undef,{'no_nav_bar' => 1}).
&Apache::lonuserutils::date_section_selector($context,
- $permission,$crstype).
- &Apache::loncommon::end_page());
+ $permission,$crstype));
} else {
- $r->print(&header().
- ''.&mt('You do not have permission to modify dates or sections for users').' '.
- &Apache::loncommon::end_page());
+ $r->print(&header(undef,{'no_nav_bar' => 1}).
+ ''.&mt('You do not have permission to modify dates or sections for users').' ');
}
} elsif ($env{'form.action'} eq 'selfenroll') {
- $r->print(&header());
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>'/adm/createuser?action=selfenroll',
- text=>"Configure Self-enrollment"});
+ push(@{$brcrum},
+ {href => '/adm/createuser?action=selfenroll',
+ text => "Configure Self-enrollment",
+ help => 'Course_Self_Enrollment'});
if (!exists($env{'form.state'})) {
- $r->print(&Apache::lonhtmlcommon::breadcrumbs('Configure Self-enrollment',
- 'Course_Self_Enrollment'));
+ $args = { bread_crumbs => $brcrum,
+ bread_crumbs_component => 'Configure Self-enrollment'};
+ $r->print(&header(undef,$args));
$r->print('
'.&mt('Self-enrollment with a student role').' '."\n");
&print_selfenroll_menu($r,$context,$permission);
} elsif ($env{'form.state'} eq 'done') {
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>'/adm/createuser?action=selfenroll',
- text=>"Result"});
- $r->print(&Apache::lonhtmlcommon::breadcrumbs('Self-enrollment result',
- 'Course_Self_Enrollment'));
+ push (@{$brcrum},
+ {href=>'/adm/createuser?action=selfenroll',
+ text=>"Result"});
+ $args = { bread_crumbs => $brcrum,
+ bread_crumbs_component => 'Self-enrollment result'};
+ $r->print(&header(undef,$args));
$r->print('
'.&mt('Self-enrollment with a student role').' '."\n");
&update_selfenroll_config($r,$context,$permission);
}
- $r->print(&Apache::loncommon::end_page());
} elsif ($env{'form.action'} eq 'selfenrollqueue') {
- $r->print(&header());
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>'/adm/createuser?action=selfenrollqueue',
- text=>"Enrollment requests"});
+ push(@{$brcrum},
+ {href => '/adm/createuser?action=selfenrollqueue',
+ text => 'Enrollment requests',
+ help => 'Course_Self_Enrollment'});
+ $bread_crumbs_component = 'Enrollment requests';
+ if ($env{'form.state'} eq 'done') {
+ push(@{$brcrum},
+ {href => '/adm/createuser?action=selfenrollqueue',
+ text => 'Result',
+ help => 'Course_Self_Enrollment'});
+ $bread_crumbs_component = 'Enrollment result';
+ }
+ $args = { bread_crumbs => $brcrum,
+ bread_crumbs_component => $bread_crumbs_component};
+ $r->print(&header(undef,$args));
my $cid = $env{'request.course.id'};
my $cdom = $env{'course.'.$cid.'.domain'};
my $cnum = $env{'course.'.$cid.'.num'};
my $coursedesc = $env{'course.'.$cid.'.description'};
if (!exists($env{'form.state'})) {
- $r->print(&Apache::lonhtmlcommon::breadcrumbs('Enrollment requests',
- 'Course_SelfEnrollment_Approval'));
$r->print('
'.&mt('Pending enrollment requests').' '."\n");
$r->print(&Apache::loncoursequeueadmin::display_queued_requests($context,
$cdom,$cnum));
} elsif ($env{'form.state'} eq 'done') {
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>'/adm/createuser?action=selfenrollqueue',
- text=>"Result"});
- $r->print(&Apache::lonhtmlcommon::breadcrumbs('Enrollment result',
- 'Course_Self_Enrollment'));
$r->print('
'.&mt('Enrollment request processing').' '."\n");
$r->print(&Apache::loncoursequeueadmin::update_request_queue($context,
$cdom,$cnum,$coursedesc));
}
- $r->print(&Apache::loncommon::end_page());
} elsif ($env{'form.action'} eq 'changelogs') {
- $r->print(&header());
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>'/adm/createuser?action=changelogs',
- text=>"User Management Logs"});
- $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Changes',
- 'Course_User_Logs'));
- &print_userchangelogs_display($r,$context,$permission);
- $r->print(&Apache::loncommon::end_page());
+ push (@{$brcrum},
+ {href => '/adm/createuser?action=changelogs',
+ text => 'User Management Logs',
+ help => 'Course_User_Logs'});
+ $bread_crumbs_component = 'User Changes';
+ $args = { bread_crumbs => $brcrum,
+ bread_crumbs_component => $bread_crumbs_component};
+ $r->print(&header(undef,$args));
+ &print_userchangelogs_display($r,$context,$permission);
} else {
- $r->print(&header());
- $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management'));
+ $bread_crumbs_component = 'User Management';
+ $args = { bread_crumbs => $brcrum,
+ bread_crumbs_component => $bread_crumbs_component};
+ $r->print(&header(undef,$args));
$r->print(&print_main_menu($permission,$context,$crstype));
- $r->print(&Apache::loncommon::end_page());
}
+ $r->print(&Apache::loncommon::end_page());
return OK;
}
sub header {
- my ($jscript,$loaditems,$args) = @_;
+ my ($jscript,$args) = @_;
my $start_page;
- if (ref($loaditems) eq 'HASH') {
- $start_page=&Apache::loncommon::start_page('User Management',$jscript,{'add_entries' => $loaditems});
- } else {
+ if (ref($args) eq 'HASH') {
$start_page=&Apache::loncommon::start_page('User Management',$jscript,$args);
+ } else {
+ $start_page=&Apache::loncommon::start_page('User Management',$jscript);
}
return $start_page;
}
--raeburn1286503179--
From www@source.lon-capa.org Sat Oct 9 18:43:25 2010
From: www@source.lon-capa.org (www)
Date: Sat, 09 Oct 2010 17:43:25 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /homework functionplotresponse.pm
Message-ID:
www Sat Oct 9 17:43:25 2010 EDT
Modified files:
/loncom/homework functionplotresponse.pm
Log:
Complete server round-trip: storing and restoring student answers
Index: loncom/homework/functionplotresponse.pm
diff -u loncom/homework/functionplotresponse.pm:1.9 loncom/homework/functionplotresponse.pm:1.10
--- loncom/homework/functionplotresponse.pm:1.9 Sat Oct 9 00:00:04 2010
+++ loncom/homework/functionplotresponse.pm Sat Oct 9 17:43:25 2010
@@ -1,7 +1,7 @@
# LearningOnline Network with CAPA
# option list style responses
#
-# $Id: functionplotresponse.pm,v 1.9 2010/10/09 00:00:04 www Exp $
+# $Id: functionplotresponse.pm,v 1.10 2010/10/09 17:43:25 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -116,6 +116,7 @@
#
# Each Geogebra applet is supposed to call this when parameters change
+# Changes the hidden fields on the web page
#
sub update_script {
my ($id)=@_;
@@ -177,6 +178,12 @@
#
sub new_coordinate {
my ($id,$variable,$x,$y)=@_;
+ if ($Apache::functionplotresponse::previous{&field_name($id,$variable,'x')}) {
+ $x=$Apache::functionplotresponse::previous{&field_name($id,$variable,'x')};
+ }
+ if ($Apache::functionplotresponse::previous{&field_name($id,$variable,'y')}) {
+ $y=$Apache::functionplotresponse::previous{&field_name($id,$variable,'y')};
+ }
&generate_input_field($id,$variable,$x,$y);
return &set_coordinate($id,$variable,$x,$y).&update_register($id,$variable);
}
@@ -286,6 +293,7 @@
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
my $label=&Apache::lonxml::get_param('label',$parstack,$safeeval);
$Apache::functionplotresponse::counter++;
+ $label=~s/\W//gs;
unless ($label) { $label='S'.$Apache::functionplotresponse::counter; }
my $order=&Apache::lonxml::get_param('order',$parstack,$safeeval);
@@ -323,6 +331,31 @@
ENDENDINIT
}
+#
+# Storing and restoring spline coordinates from part answers
+#
+sub decode_previous_answer {
+ my ($answer)=@_;
+ foreach my $coordinate (split(/\,/,$answer)) {
+ my ($key,$value)=split(/\=/,$coordinate);
+ $Apache::functionplotresponse::previous{$key}=$value;
+ }
+}
+
+sub get_answer_from_form_fields {
+ my ($id)=@_;
+ my $answer='';
+ my %coords=();
+ foreach my $field (keys(%env)) {
+ if ($field=~/^form\.HWVAL\_$id/) {
+ $field=~/^form\.(.*)$/;
+ $coords{$1}=$env{$field};
+ }
+ }
+ $answer=join(',',map { $_.'='.$coords{$_} } (sort(keys(%coords))));
+ return ($answer,%coords);
+}
+
sub start_functionplotresponse {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
my $result='';
@@ -332,10 +365,18 @@
undef %Apache::functionplotresponse::splineinity;
undef %Apache::functionplotresponse::splinescalex;
undef %Apache::functionplotresponse::splinescaley;
+# Remember input fields, etc
+ undef %Apache::functionplotresponse::previous;
$Apache::functionplotresponse::inputfields='';
$Apache::functionplotresponse::counter=0;
+# Part and ID
+ my $partid=$Apache::inputtags::part;
+ my $id=&Apache::response::start_response($parstack,$safeeval);
# Internal ID to mark the applet and its coordinates
- my $internalid = $Apache::inputtags::part.'_'.&Apache::response::start_response($parstack,$safeeval);
+ my $internalid = $partid.'_'.$id;
+# Previous answer
+ &decode_previous_answer($Apache::lonhomework::history{"resource.$partid.$id.submission"});
+
# Parameters of
my $xmin=&Apache::lonxml::get_param('xmin',$parstack,$safeeval);
$xmin=($xmin?$xmin:-10);
@@ -349,7 +390,9 @@
my $yaxisvisible=(&Apache::lonxml::get_param('yaxisvisible',$parstack,$safeeval)=~/on|true|yes|1/i?'true':'false');
my $gridvisible=(&Apache::lonxml::get_param('gridvisible',$parstack,$safeeval)=~/on|true|yes|1/i?'true':'false');
- if ($target eq 'web') {
+ if ($target eq 'meta') {
+ $result=&Apache::response::meta_package_write('functionplotresponse');
+ } elsif ($target eq 'web') {
# paste in the update routine to receive stuff back from the applet
$result.=&update_script($internalid);
# start the initscript for this applet
@@ -366,10 +409,25 @@
&Apache::response::end_response;
my $result;
- my $internalid = $Apache::inputtags::part.'_'.$Apache::inputtags::response[-1];
+ my $id=$Apache::inputtags::response[-1];
+ my $partid=$Apache::inputtags::part;
+ my $internalid = $partid.'_'.$id;
# if ($target eq 'edit') { $result=&Apache::edit::end_table(); }
- if ($target eq 'web') {
+ if ($target eq 'grade'
+ && &Apache::response::submitted()
+ && $Apache::lonhomework::type eq 'exam') {
+
+ #&Apache::response::scored_response($partid,$id);
+
+ } elsif ($target eq 'grade'
+ && &Apache::response::submitted()
+ && $Apache::lonhomework::type ne 'exam') {
+ my ($response,%coords)=&get_answer_from_form_fields($internalid);
+ $Apache::lonhomework::results{"resource.$partid.$id.submission"}=$response;
+ $Apache::lonhomework::results{"resource.$partid.$id.awarddetail"}='INCORRECT';
+
+ } elsif ($target eq 'web') {
# Now is the time to render all of the stored splines
foreach my $label (keys(%Apache::functionplotresponse::splineorder)) {
$result.=&generate_spline($internalid,$label);
From www@source.lon-capa.org Sat Oct 9 21:02:02 2010
From: www@source.lon-capa.org (www)
Date: Sat, 09 Oct 2010 20:02:02 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /homework functionplotresponse.pm
Message-ID:
www Sat Oct 9 20:02:02 2010 EDT
Modified files:
/loncom/homework functionplotresponse.pm
Log:
Coordinates can be zero ...
Index: loncom/homework/functionplotresponse.pm
diff -u loncom/homework/functionplotresponse.pm:1.10 loncom/homework/functionplotresponse.pm:1.11
--- loncom/homework/functionplotresponse.pm:1.10 Sat Oct 9 17:43:25 2010
+++ loncom/homework/functionplotresponse.pm Sat Oct 9 20:02:02 2010
@@ -1,7 +1,7 @@
# LearningOnline Network with CAPA
# option list style responses
#
-# $Id: functionplotresponse.pm,v 1.10 2010/10/09 17:43:25 www Exp $
+# $Id: functionplotresponse.pm,v 1.11 2010/10/09 20:02:02 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -178,10 +178,10 @@
#
sub new_coordinate {
my ($id,$variable,$x,$y)=@_;
- if ($Apache::functionplotresponse::previous{&field_name($id,$variable,'x')}) {
+ if (defined($Apache::functionplotresponse::previous{&field_name($id,$variable,'x')})) {
$x=$Apache::functionplotresponse::previous{&field_name($id,$variable,'x')};
}
- if ($Apache::functionplotresponse::previous{&field_name($id,$variable,'y')}) {
+ if (defined($Apache::functionplotresponse::previous{&field_name($id,$variable,'y')})) {
$y=$Apache::functionplotresponse::previous{&field_name($id,$variable,'y')};
}
&generate_input_field($id,$variable,$x,$y);
From www@source.lon-capa.org Sat Oct 9 23:31:49 2010
From: www@source.lon-capa.org (www)
Date: Sat, 09 Oct 2010 22:31:49 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /homework edit.pm functionplotresponse.pm insertlist.xml
Message-ID:
www Sat Oct 9 22:31:49 2010 EDT
Modified files:
/loncom/homework edit.pm functionplotresponse.pm insertlist.xml
Log:
Recognize previous tries
Work on colorful editor
Index: loncom/homework/edit.pm
diff -u loncom/homework/edit.pm:1.129 loncom/homework/edit.pm:1.130
--- loncom/homework/edit.pm:1.129 Mon Sep 27 22:15:32 2010
+++ loncom/homework/edit.pm Sat Oct 9 22:31:49 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# edit mode helpers
#
-# $Id: edit.pm,v 1.129 2010/09/27 22:15:32 www Exp $
+# $Id: edit.pm,v 1.130 2010/10/09 22:31:49 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -400,6 +400,8 @@
sub insert_functionplotresponse {
return '
+
+
';
}
Index: loncom/homework/functionplotresponse.pm
diff -u loncom/homework/functionplotresponse.pm:1.11 loncom/homework/functionplotresponse.pm:1.12
--- loncom/homework/functionplotresponse.pm:1.11 Sat Oct 9 20:02:02 2010
+++ loncom/homework/functionplotresponse.pm Sat Oct 9 22:31:49 2010
@@ -1,7 +1,7 @@
# LearningOnline Network with CAPA
# option list style responses
#
-# $Id: functionplotresponse.pm,v 1.11 2010/10/09 20:02:02 www Exp $
+# $Id: functionplotresponse.pm,v 1.12 2010/10/09 22:31:49 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -33,7 +33,7 @@
use Apache::lonnet;
BEGIN {
- &Apache::lonxml::register('Apache::functionplotresponse',('functionplotresponse','backgroundplot','spline'));
+ &Apache::lonxml::register('Apache::functionplotresponse',('functionplotresponse','backgroundplot','spline','splinerule'));
}
#
@@ -285,6 +285,21 @@
}
#
+#
+#
+sub start_splinerule {
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
+ my $result='';
+ my $internalid = $Apache::inputtags::part.'_'.$Apache::inputtags::response[-1];
+ return $result;
+}
+
+sub end_splinerule {
+ return '';
+}
+
+
+#
#
#
# Unfortunately, GeoGebra seems to want all splines after everything else, so we need to store them
@@ -389,10 +404,40 @@
my $xaxisvisible=(&Apache::lonxml::get_param('xaxisvisible',$parstack,$safeeval)=~/on|true|yes|1/i?'true':'false');
my $yaxisvisible=(&Apache::lonxml::get_param('yaxisvisible',$parstack,$safeeval)=~/on|true|yes|1/i?'true':'false');
my $gridvisible=(&Apache::lonxml::get_param('gridvisible',$parstack,$safeeval)=~/on|true|yes|1/i?'true':'false');
+ if ($target eq 'edit') {
+ $result.=&Apache::edit::start_table($token)
+ .''.&mt('Function Plot Question').' '
+ .''.&mt('Delete?').' '
+ .&Apache::edit::deletelist($target,$token)
+ .' '
+ ." "
+ .&Apache::edit::end_row()
+ .&Apache::edit::start_spanning_row()
+ ."\n";
+ $result.=&Apache::edit::text_arg('Minimum x-value:','xmin',
+ $token,'4').
+ &Apache::edit::text_arg('Maximum x-value:','xmax',
+ $token,'4').
+ &Apache::edit::select_arg('x-axis visible:','xaxisvisible',
+ ['yes','no'],$token).
+ &Apache::edit::text_arg('Minimum y-value:','ymin',
+ $token,'4').
+ &Apache::edit::text_arg('Maximum y-value:','ymax',
+ $token,'4').
+ &Apache::edit::select_arg('y-axis visible:','yaxisvisible',
+ ['yes','no'],$token).
+ &Apache::edit::select_arg('Grid visible:','gridvisible',
+ ['yes','no'],$token).
+ &Apache::edit::end_row().&Apache::edit::start_spanning_row();
+ } elsif ($target eq 'modified') {
+ my $constructtag=&Apache::edit::get_new_args($token,$parstack,
+ $safeeval,'xmin','xmax','ymin','ymax',
+ 'xaxisvisible','yaxisvisible','gridvisible');
+ if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
- if ($target eq 'meta') {
+ } elsif ($target eq 'meta') {
$result=&Apache::response::meta_package_write('functionplotresponse');
- } elsif ($target eq 'web') {
+ } elsif ($target eq 'web') {
# paste in the update routine to receive stuff back from the applet
$result.=&update_script($internalid);
# start the initscript for this applet
@@ -413,7 +458,7 @@
my $partid=$Apache::inputtags::part;
my $internalid = $partid.'_'.$id;
-# if ($target eq 'edit') { $result=&Apache::edit::end_table(); }
+ if ($target eq 'edit') { $result=&Apache::edit::end_table(); }
if ($target eq 'grade'
&& &Apache::response::submitted()
&& $Apache::lonhomework::type eq 'exam') {
@@ -425,8 +470,16 @@
&& $Apache::lonhomework::type ne 'exam') {
my ($response,%coords)=&get_answer_from_form_fields($internalid);
$Apache::lonhomework::results{"resource.$partid.$id.submission"}=$response;
- $Apache::lonhomework::results{"resource.$partid.$id.awarddetail"}='INCORRECT';
-
+ my %previous=&Apache::response::check_for_previous($response,$partid,$id);
+#
+# Actually grade
+#
+ my $ad='INCORRECT';
+#
+# Store grading info
+#
+ $Apache::lonhomework::results{"resource.$partid.$id.awarddetail"}=$ad;
+ &Apache::response::handle_previous(\%previous,$ad);
} elsif ($target eq 'web') {
# Now is the time to render all of the stored splines
foreach my $label (keys(%Apache::functionplotresponse::splineorder)) {
Index: loncom/homework/insertlist.xml
diff -u loncom/homework/insertlist.xml:1.18 loncom/homework/insertlist.xml:1.19
--- loncom/homework/insertlist.xml:1.18 Mon Sep 27 22:15:32 2010
+++ loncom/homework/insertlist.xml Sat Oct 9 22:31:49 2010
@@ -20,6 +20,24 @@
Response: Function Plot
#77DD55
insert_functionplotresponse
+ spline,backgroundplot,splinerule
+
+
+ Spline
+ #aaff99
+ default
+
+
+
+ Background Function Plot
+ #DDDD55
+ default
+
+
+
+ Spline Evaluation Rule
+ #99ff88
+ default
From raeburn@source.lon-capa.org Thu Oct 7 15:45:05 2010
From: raeburn@source.lon-capa.org (raeburn)
Date: Thu, 07 Oct 2010 14:45:05 -0000
Subject: [LON-CAPA-cvs] cvs: loncom(version_2_9_X) /interface coursecatalog.pm
Message-ID:
raeburn Thu Oct 7 14:45:05 2010 EDT
Modified files: (Branch: version_2_9_X)
/loncom/interface coursecatalog.pm
Log:
- Backport 1.65.
Index: loncom/interface/coursecatalog.pm
diff -u loncom/interface/coursecatalog.pm:1.53.4.6 loncom/interface/coursecatalog.pm:1.53.4.7
--- loncom/interface/coursecatalog.pm:1.53.4.6 Fri Aug 20 03:59:11 2010
+++ loncom/interface/coursecatalog.pm Thu Oct 7 14:45:04 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler for displaying the course catalog interface
#
-# $Id: coursecatalog.pm,v 1.53.4.6 2010/08/20 03:59:11 raeburn Exp $
+# $Id: coursecatalog.pm,v 1.53.4.7 2010/10/07 14:45:04 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -402,7 +402,7 @@
$catlinks .= ''.&mt('De-select').' ';
for (my $j=0; $j<@{$cats[$shallower]{$container}}; $j++) {
my $name = $cats[$shallower]{$container}[$j];
- my $item = &escape($name).':'.$container.':'.$shallower;
+ my $item = &escape($name).':'.&escape($container).':'.$shallower;
my $selected = '';
if ($item eq $env{'form.currcat_'.$shallower}) {
$selected = ' selected="selected"';
From www@source.lon-capa.org Sun Oct 10 01:14:15 2010
From: www@source.lon-capa.org (www)
Date: Sun, 10 Oct 2010 00:14:15 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /homework edit.pm functionplotresponse.pm insertlist.xml
Message-ID:
This is a MIME encoded message
--www1286669655
Content-Type: text/plain
www Sun Oct 10 00:14:15 2010 EDT
Modified files:
/loncom/homework edit.pm functionplotresponse.pm insertlist.xml
Log:
Colorful editor for the existing functionplotresponse tags.
--www1286669655
Content-Type: text/plain
Content-Disposition: attachment; filename="www-20101010001415.txt"
Index: loncom/homework/edit.pm
diff -u loncom/homework/edit.pm:1.130 loncom/homework/edit.pm:1.131
--- loncom/homework/edit.pm:1.130 Sat Oct 9 22:31:49 2010
+++ loncom/homework/edit.pm Sun Oct 10 00:14:15 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# edit mode helpers
#
-# $Id: edit.pm,v 1.130 2010/10/09 22:31:49 www Exp $
+# $Id: edit.pm,v 1.131 2010/10/10 00:14:15 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -405,6 +405,23 @@
';
}
+sub insert_spline {
+ return '
+ ';
+}
+
+sub insert_backgroundplot {
+ return '
+ ';
+}
+
+sub insert_splinerule {
+ return '
+ ';
+}
+
+
+
sub insert_numericalresponse {
return '
Index: loncom/homework/functionplotresponse.pm
diff -u loncom/homework/functionplotresponse.pm:1.12 loncom/homework/functionplotresponse.pm:1.13
--- loncom/homework/functionplotresponse.pm:1.12 Sat Oct 9 22:31:49 2010
+++ loncom/homework/functionplotresponse.pm Sun Oct 10 00:14:15 2010
@@ -1,7 +1,7 @@
# LearningOnline Network with CAPA
# option list style responses
#
-# $Id: functionplotresponse.pm,v 1.12 2010/10/09 22:31:49 www Exp $
+# $Id: functionplotresponse.pm,v 1.13 2010/10/10 00:14:15 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -276,12 +276,28 @@
unless ($function) { $function="0"; }
if ($target eq 'web') {
$result.=&plot_script($internalid,$function,$fixed);
- }
- return $result;
+ } elsif ($target eq 'edit') {
+ $result=&Apache::edit::tag_start($target,$token,'Background Function Plot').
+ &Apache::edit::text_arg('Function:','function',
+ $token,'16').
+ &Apache::edit::select_arg('Fixed location:','fixed',
+ ['yes','no'],$token).
+ &Apache::edit::end_row();
+ } elsif ($target eq 'modified') {
+ my $constructtag=&Apache::edit::get_new_args($token,$parstack,
+ $safeeval,'function','fixed');
+ if ($constructtag) { $result=&Apache::edit::rebuild_tag($token); }
+ }
+ return $result;
}
sub end_backgroundplot {
- return '';
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
+ my $result='';
+ if ($target eq 'edit') {
+ $result=&Apache::edit::end_table();
+ }
+ return $result;
}
#
@@ -291,11 +307,20 @@
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
my $result='';
my $internalid = $Apache::inputtags::part.'_'.$Apache::inputtags::response[-1];
+ if ($target eq 'edit') {
+ $result=&Apache::edit::tag_start($target,$token,'Spline Evaluation Rule').
+ &Apache::edit::end_row();
+ }
return $result;
}
sub end_splinerule {
- return '';
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
+ my $result='';
+ if ($target eq 'edit') {
+ $result=&Apache::edit::end_table();
+ }
+ return $result;
}
@@ -306,36 +331,70 @@
#
sub start_spline {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
- my $label=&Apache::lonxml::get_param('label',$parstack,$safeeval);
- $Apache::functionplotresponse::counter++;
- $label=~s/\W//gs;
- unless ($label) { $label='S'.$Apache::functionplotresponse::counter; }
-
- my $order=&Apache::lonxml::get_param('order',$parstack,$safeeval);
- if ($order<2) { $order=2; }
- if ($order>8) { $order=8; }
- $Apache::functionplotresponse::splineorder{$label}=$order;
-
- my $x=&Apache::lonxml::get_param('initx',$parstack,$safeeval);
- unless ($x) { $x=0; }
- $Apache::functionplotresponse::splineinitx{$label}=$x;
-
- my $y=&Apache::lonxml::get_param('inity',$parstack,$safeeval);
- unless ($y) { $y=0; }
- $Apache::functionplotresponse::splineinity{$label}=$y;
-
- my $sx=&Apache::lonxml::get_param('scalex',$parstack,$safeeval);
- unless ($sx) { $sx=$order; }
- $Apache::functionplotresponse::splinescalex{$label}=$sx;
-
- my $sy=&Apache::lonxml::get_param('scaley',$parstack,$safeeval);
- unless ($sy) { $sy=2; }
- $Apache::functionplotresponse::splinescaley{$label}=$sy;
- return '';
+ my $result='';
+ if ($target eq 'web') {
+ my $label=&Apache::lonxml::get_param('label',$parstack,$safeeval);
+ $Apache::functionplotresponse::counter++;
+ if ($label=~/\W/) {
+ &Apache::lonxml::warning(&mt('Spline labels should only contain alphanumeric characters.'));
+ }
+ $label=~s/\W//gs;
+ unless ($label) { $label='S'.$Apache::functionplotresponse::counter; }
+ if ($Apache::functionplotresponse::splineorder{$label}) {
+ &Apache::lonxml::error(&mt('Spline labels must be unique.'));
+ }
+
+ my $order=&Apache::lonxml::get_param('order',$parstack,$safeeval);
+ if ($order<2) { $order=2; }
+ if ($order>8) { $order=8; }
+ $Apache::functionplotresponse::splineorder{$label}=$order;
+
+ my $x=&Apache::lonxml::get_param('initx',$parstack,$safeeval);
+ unless ($x) { $x=0; }
+ $Apache::functionplotresponse::splineinitx{$label}=$x;
+
+ my $y=&Apache::lonxml::get_param('inity',$parstack,$safeeval);
+ unless ($y) { $y=0; }
+ $Apache::functionplotresponse::splineinity{$label}=$y;
+
+ my $sx=&Apache::lonxml::get_param('scalex',$parstack,$safeeval);
+ unless ($sx) { $sx=$order; }
+ $Apache::functionplotresponse::splinescalex{$label}=$sx;
+
+ my $sy=&Apache::lonxml::get_param('scaley',$parstack,$safeeval);
+ unless ($sy) { $sy=2; }
+ $Apache::functionplotresponse::splinescaley{$label}=$sy;
+ } elsif ($target eq 'edit') {
+ $result=&Apache::edit::tag_start($target,$token,'Spline').
+ &Apache::edit::text_arg('Label:','label',
+ $token,'4').
+ &Apache::edit::select_arg('Order:','order',
+ ['2','3','4','5','6','7','8','9'],$token).
+ &Apache::edit::text_arg('Initial x-value:','initx',
+ $token,'4').
+ &Apache::edit::text_arg('Initial y-value:','inity',
+ $token,'4').
+ &Apache::edit::text_arg('Scale x:','scalex',
+ $token,'4').
+ &Apache::edit::text_arg('Scale y:','scaley',
+ $token,'4').
+ &Apache::edit::end_row();
+ } elsif ($target eq 'modified') {
+ my $constructtag=&Apache::edit::get_new_args($token,$parstack,
+ $safeeval,'label','order','initx','inity',
+ 'scalex','scaley');
+ if ($constructtag) { $result=&Apache::edit::rebuild_tag($token); }
+ }
+ return $result;
}
sub end_spline {
- return '';
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
+ my $result='';
+ if ($target eq 'edit') {
+ $result=&Apache::edit::end_table();
+ }
+ return $result;
}
sub end_init_script {
Index: loncom/homework/insertlist.xml
diff -u loncom/homework/insertlist.xml:1.19 loncom/homework/insertlist.xml:1.20
--- loncom/homework/insertlist.xml:1.19 Sat Oct 9 22:31:49 2010
+++ loncom/homework/insertlist.xml Sun Oct 10 00:14:15 2010
@@ -25,19 +25,19 @@
Spline
#aaff99
- default
+ insert_spline
Background Function Plot
#DDDD55
- default
+ insert_backgroundplot
Spline Evaluation Rule
#99ff88
- default
+ insert_splinerule
--www1286669655--
From www@source.lon-capa.org Sat Oct 9 00:26:05 2010
From: www@source.lon-capa.org (www)
Date: Fri, 08 Oct 2010 23:26:05 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /homework functionplotresponse.pm
Message-ID:
www Fri Oct 8 23:26:05 2010 EDT
Modified files:
/loncom/homework functionplotresponse.pm
Log:
Correct scaling and maximum spline order
Index: loncom/homework/functionplotresponse.pm
diff -u loncom/homework/functionplotresponse.pm:1.7 loncom/homework/functionplotresponse.pm:1.8
--- loncom/homework/functionplotresponse.pm:1.7 Tue Oct 5 01:28:00 2010
+++ loncom/homework/functionplotresponse.pm Fri Oct 8 23:26:04 2010
@@ -1,7 +1,7 @@
# LearningOnline Network with CAPA
# option list style responses
#
-# $Id: functionplotresponse.pm,v 1.7 2010/10/05 01:28:00 www Exp $
+# $Id: functionplotresponse.pm,v 1.8 2010/10/08 23:26:04 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -228,10 +228,10 @@
my @coords=();
foreach my $i (1..$order) {
$result.=&new_coordinate($id,$label.'P'.$i,$x,$y);
- $x+=$sx/$order;
+ $x+=$sx/(2.*($order-1));
push(@coords,$label.'P'.$i);
$result.=&new_coordinate($id,$label.'S'.$i,$x,$y+$sy);
- $x+=$sx/$order;
+ $x+=$sx/(2.*($order-1));
push(@coords,$label.'S'.$i);
}
$result.='document.ggbApplet_'.$id.'.evalCommand("Spline'.$order.'['.join(',',@coords).']");'."\n";
@@ -270,7 +270,8 @@
unless ($label) { $label='S'.$Apache::functionplotresponse::counter; }
my $order=&Apache::lonxml::get_param('order',$parstack,$safeeval);
- if (($order<2) || ($order>4)) { $order=2; }
+ if ($order<2) { $order=2; }
+ if ($order>8) { $order=8; }
$Apache::functionplotresponse::splineorder{$label}=$order;
my $x=&Apache::lonxml::get_param('initx',$parstack,$safeeval);
From ramirez@source.lon-capa.org Wed Oct 6 17:33:58 2010
From: ramirez@source.lon-capa.org (ramirez)
Date: Wed, 06 Oct 2010 16:33:58 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /localize/localize es.pm
Message-ID:
This is a MIME encoded message
--ramirez1286382838
Content-Type: text/plain
ramirez Wed Oct 6 16:33:58 2010 EDT
Modified files:
/loncom/localize/localize es.pm
Log:
added about 40 new phrases
--ramirez1286382838
Content-Type: text/plain
Content-Disposition: attachment; filename="ramirez-20101006163358.txt"
Index: loncom/localize/localize/es.pm
diff -u loncom/localize/localize/es.pm:1.58 loncom/localize/localize/es.pm:1.59
--- loncom/localize/localize/es.pm:1.58 Fri Oct 1 14:19:52 2010
+++ loncom/localize/localize/es.pm Wed Oct 6 16:33:58 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Spanish Localization Lexicon
#
-# $Id: es.pm,v 1.58 2010/10/01 14:19:52 raeburn Exp $
+# $Id: es.pm,v 1.59 2010/10/06 16:33:58 ramirez Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1072,7 +1072,7 @@
=> 'La extensión de este archivo',
'Unsupported character combination [_1] in filename, FAIL.'
-=> 'Combinación de caracteres no soportada [_1] en archivo, FALLÓ.',
+=> 'Combinación de caracteres incompatible [_1] en archivo, FALLÓ.',
'No valid extension found in filename, FAIL'
=> 'Extensión no valida encontrada en archivo, FALLÓ',
@@ -3711,9 +3711,6 @@
'Course Content'
=> 'Contenido del Curso',
- 'Course Contents'
-=> 'Contenido del Curso',
-
'Course Data'
=> 'Fecha del Curso',
@@ -12373,7 +12370,7 @@
=> '[_1]: No se pudo añadir función: [_2]',
'No change in section assignment (none)'
-=> 'Sin cambios la asignación de sección (none)',
+=> 'Sin cambios la asignación de sección (ninguno)',
"Revoked role of '[_1]' in [_2] for [_3]"
=> "Función de '[_1]' Revocada en [_2] para [_3]",
@@ -17901,6 +17898,171 @@
'This request has already been processed, and a course created.'
=> 'Esta solicitud ya fue procesada, y un curso creado.',
+ 'To access your LON-CAPA message, go to the Main Menu and click on "Send and Receive Messages".'
+=> 'Para acceder a su mensaje LON-CAPA, ir al Menú Principal y pulsar en "Enviar y Recibir mensajes".',
+
+ 'Tolerance'
+=> 'Tolerancia',
+
+ 'Unable to determine status due to network problems.'
+=> 'No se pudo determinar el estado debido a problemas en la red.',
+
+ 'Unable to retrieve information about community contents'
+=> 'No se pudo recuperar la información sobre el contenido de la comunidad',
+
+ 'Unable to retrieve information about course contents'
+=> 'No se pudo recuperar la información sobre el contenido del curso',
+
+ 'Unit'
+=> 'Unidad',
+
+ 'Unknown type'
+=> 'Tipo desconocido',
+
+ 'Unofficial'
+=> 'No oficial',
+
+ 'unofficial'
+=> 'no oficial',
+
+ 'official'
+=> 'oficial',
+
+ 'Unofficial course'
+=> 'Curso no oficial',
+
+ 'Unofficial courses'
+=> 'Cursos no oficiales',
+
+ 'Unrecognized course type: [_1]'
+=> 'Tipo de curso desconocido: [_1]',
+
+ 'Unsupported IMS format: [_1]'
+=> 'Formato IMS incompatible: [_1]',
+
+ 'Upload IMS package'
+=> 'Cargar paquete IMS',
+
+ 'Upload a courses or communities attributes file'
+=> 'Cargar un archivo de atributo de cursos o comunidades',
+
+ 'Upload Course/Community Attributes File'
+=> 'Cargar Archivo de Atributos de Curso/Comunidad',
+
+ 'Create Courses/Communities'
+=> 'Crear Cursos/Comunidades',
+
+ 'Upload an attributes file containing specifications for one or more courses or communities in XML format.'
+=> 'Cargar un archivo de atributos con especificaciones para uno o más cursos o comunidades en formato XML.',
+
+ 'Uploaded file contained no data'
+=> 'Archivo Cargado estaba sin datos',
+
+ "Use 'Save' in the main window to save community categories"
+=> "Usar 'Guardar' en la ventana principal para guardar categorías de comunidad",
+
+ "Use 'Save' in the main window to save course categories"
+=> "Usar 'Guardar' en la ventana principal para guardar categorías de cursos",
+
+ 'Use the following link to enter the community:'
+=> 'Usar el siguiente enlace para entrar a la comunidad:',
+
+ 'Use the following link to enter the course:'
+=> 'Usar el siguiente enlace para entrar al curso:',
+
+ 'Use the following links to your new roles to enter the community:'
+=> 'Usar los siguientes enlaces a sus funciones para entrar a la comunidad:',
+
+ 'Use the following links to your new roles to enter the course:'
+=> 'Usar los siguientes enlaces a sus funciones para entrar al curso:',
+
+ 'User Search to enroll member'
+=> 'Buscar Usuario para inscribir miembro',
+
+ 'User does not exist - username: [_1], domain: [_2].'
+=> 'Usuario no existe - usuario: [_1], dominio: [_2].',
+
+ 'You are not permitted to create a LON-CAPA account.'
+=> 'No tiene permiso de crear una cuenta LON-CAPA.',
+
+ 'You do not have privileges to request creation of courses or communities.'
+=> 'No tiene privilegios de solicitar creación de cursos o comunidades.',
+
+ 'You do not have rights to request creation of courses in this domain; please choose a different domain.'
+=> 'No está autorizado a solicitar creación de cursos en este dominio; por favor elija un dominio diferente.',
+
+ 'You do not have privileges to modify Portfolio, Blog or Personal Information Page settings for this user.'
+=> 'No tiene privilegios de modificar Portafolio, Blog o la configuración de la Página de Información Personal para este usuario.',
+
+ 'You may also add users later, once the community has been created, by using the "Manage community users" link, accessible from the "Main Menu".'
+=> 'Puede añadir usuarios después, una vez la comunidad ha sido creada, usando el enlace "Control de usuarios de comunidad", accesible desde el "Menú Principal".',
+
+ 'You may also add users later, once the course has been created, by using the "Manage course users" link, accessible from the "Main Menu".'
+=> 'Puede añadir usuarios después, una vez el curso ha sido creado, usando el enlace "Control de usuarios del curso", accesible desde el "Menú Principal".',
+
+ 'You must select a course or community in the current domain'
+=> 'Debe seleccionar un curso o comunidad en el dominio actual',
+
+ 'You need to change one or more LON-CAPA section names - names may only contain letters or numbers.'
+=> 'Necesita cambiar nombres de una o más secciones LON-CAPA - los nombres sólo pueden tener letras o números.',
+
+ 'You need to change one or more LON-CAPA section names - none is a reserved word in the system, and may not be used.'
+=> 'Necesita cambiar nombres de una o más secciones LON-CAPA - "ninguno" es una palabra reservada en el sistema y no puede ser usada.',
+
+ 'You need to re-initialize the community.'
+=> 'Necesita re-iniciar la comunidad.',
+
+ 'You need to reinitialize the community.'
+=> 'Necesita reiniciar la comunidad.',
+
+ 'Your community request has been cancelled.'
+=> 'Su solicitud de comunidad ha sido cancelada.',
+
+ 'Your community request has been recorded.'
+=> 'Su solicitud de comunidad ha sido registrada.',
+
+ 'Your community request has been updated'
+=> 'Su solicitud de comunidad ha sido actualizada.',
+
+ 'Your community request was rejected.'
+=> 'Su solicitud de comunidad ha sido rechazada.',
+
+ 'Your course request has been cancelled.'
+=> 'Su solicitud de curso ha sido cancelada.',
+
+ 'Your course request has been recorded.'
+=> 'Su solicitud de curso ha sido registrada.',
+
+ 'Your course request has been updated'
+=> 'Su solicitud de curso ha sido actualizada.',
+
+ 'Your course request was rejected.'
+=> 'Su solicitud de curso ha sido rechazada.',
+
+ 'Your community request has been processed and the community has been created.'
+=> 'Su solicitud de comunidad ha sido procesada y la comunidad ha sido creada.',
+
+ 'Your course request has been processed and the course has been created.'
+=> 'Su solicitud de curso ha sido procesada y el curso ha sido creado.',
+
+ 'Your file - [_1] - was uploaded successfully.'
+=> 'Su archivo - [_1] - fue cargado exitósamente.',
+
+ 'Your import is complete.'
+=> 'Su importación está completa.',
+
+ 'Your limit is [_1].'
+=> 'Su límite es [_1].',
+
+ 'Your request has not been processed because you have reached the limit for the number of communities.'
+=> 'Su solicitud no ha sido procesada, porque llegó al límite para el número de comunidades.',
+
+ 'Your request has not been processed because you have reached the limit for the number of courses of this type.'
+=> 'Su solicitud no ha sido procesada, porque llegó al límite para el número de cursos de este tipo.',
+
+ 'Your request status is: [_1].'
+=> 'El estado de su solicitud es: [_1].',
+
''
=> '',
--ramirez1286382838--
From www@source.lon-capa.org Sat Oct 9 01:00:04 2010
From: www@source.lon-capa.org (www)
Date: Sat, 09 Oct 2010 00:00:04 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /homework functionplotresponse.pm
Message-ID:
www Sat Oct 9 00:00:04 2010 EDT
Modified files:
/loncom/homework functionplotresponse.pm
Log:
Handing back spline data in form fields for server evaluation
Index: loncom/homework/functionplotresponse.pm
diff -u loncom/homework/functionplotresponse.pm:1.8 loncom/homework/functionplotresponse.pm:1.9
--- loncom/homework/functionplotresponse.pm:1.8 Fri Oct 8 23:26:04 2010
+++ loncom/homework/functionplotresponse.pm Sat Oct 9 00:00:04 2010
@@ -1,7 +1,7 @@
# LearningOnline Network with CAPA
# option list style responses
#
-# $Id: functionplotresponse.pm,v 1.8 2010/10/08 23:26:04 www Exp $
+# $Id: functionplotresponse.pm,v 1.9 2010/10/09 00:00:04 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -125,8 +125,8 @@
function updatePointCoordinates_$id(coordinateName) {
var x = document.ggbApplet_$id.getXcoord(coordinateName);
var y = document.ggbApplet_$id.getYcoord(coordinateName);
- coordinateMap_$id\[coordinateName + ".x"] = x;
- coordinateMap_$id\[coordinateName + ".y"] = y;
+ document.lonhomework.elements["HWVAL_$id\_" + coordinateName + "_x"].value = x;
+ document.lonhomework.elements["HWVAL_$id\_" + coordinateName + "_y"].value = y;
}
// ]]>
@@ -148,17 +148,36 @@
sub set_coordinate {
my ($id,$variable,$x,$y)=@_;
return (< \n".
+ " \n";
+}
+
+#
# Initialize a new coordinate variable at set a listener on it
#
sub new_coordinate {
my ($id,$variable,$x,$y)=@_;
+ &generate_input_field($id,$variable,$x,$y);
return &set_coordinate($id,$variable,$x,$y).&update_register($id,$variable);
}
@@ -313,6 +332,7 @@
undef %Apache::functionplotresponse::splineinity;
undef %Apache::functionplotresponse::splinescalex;
undef %Apache::functionplotresponse::splinescaley;
+ $Apache::functionplotresponse::inputfields='';
$Apache::functionplotresponse::counter=0;
# Internal ID to mark the applet and its coordinates
my $internalid = $Apache::inputtags::part.'_'.&Apache::response::start_response($parstack,$safeeval);
@@ -356,6 +376,8 @@
}
# close the init script
$result.=&end_init_script();
+# generate the input fields
+ $result.=$Apache::functionplotresponse::inputfields;
# actually start the -tag
$result.=&geogebra_startcode($internalid);
# load the spline bytecode
From raeburn@source.lon-capa.org Wed Oct 6 19:46:53 2010
From: raeburn@source.lon-capa.org (raeburn)
Date: Wed, 06 Oct 2010 18:46:53 -0000
Subject: [LON-CAPA-cvs] cvs: loncom(GCI_3) /auth lonroles.pm
Message-ID:
raeburn Wed Oct 6 18:46:53 2010 EDT
Modified files: (Branch: GCI_3)
/loncom/auth lonroles.pm
Log:
- Customization for GCI_3.
- Substitute the term 'Concept Tests' for 'Roles' when appropriate.
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.240.2.17 loncom/auth/lonroles.pm:1.240.2.18
--- loncom/auth/lonroles.pm:1.240.2.17 Mon Oct 4 17:43:24 2010
+++ loncom/auth/lonroles.pm Wed Oct 6 18:46:53 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# User Roles Screen
#
-# $Id: lonroles.pm,v 1.240.2.17 2010/10/04 17:43:24 raeburn Exp $
+# $Id: lonroles.pm,v 1.240.2.18 2010/10/06 18:46:53 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -592,6 +592,7 @@
return OK if $r->header_only;
my ($crumbtext,$pagetitle,$recent,$show_course);
+ $show_course=&Apache::loncommon::show_course();
my $noscript=''.&mt('Use of LON-CAPA requires Javascript to be enabled in your web browser.').' '.&mt('As this is not the case, most functionality in the system will be unavailable.').' ';
if ($custommenu) {
my $brcrum = {'bread_crumbs' => 1};
@@ -610,16 +611,25 @@
$crumbtext = 'User Roles';
$pagetitle = 'My Roles';
$recent = &mt('Recent Roles');
- $show_course=&Apache::loncommon::show_course();
+ my $standby=&mt('Role selected. Please stand by.');
if ($show_course) {
$crumbtext = 'Courses';
$pagetitle = 'My Courses';
$recent = &mt('Recent Courses');
+ $standby = &mt('Course selected. Please stand by.');
+ }
+ my $brcrum = [{ href => '/adm/roles',
+ text => $crumbtext,},
+ ];
+ my $args;
+ if (($env{'user.domain'} eq 'gcitest') && (!$numdc)) {
+ $args = {bread_crumbs => $brcrum,
+ bread_crumbs_nomenu => 1};
+ } else {
+ $args = {bread_crumbs => $brcrum};
}
- my $brcrum =[{href=>"/adm/roles",text=>$crumbtext}];
+ my $start_page=&Apache::loncommon::start_page($pagetitle,undef,$args);
my $swinfo=&Apache::lonmenu::rawconfig();
- my $start_page=&Apache::loncommon::start_page($pagetitle,undef,{bread_crumbs=>$brcrum});
- my $standby=&mt('Role selected. Please stand by.');
$standby=~s/\n/\\n/g;
$r->print(<print(''.&mt('Currently no additional roles, courses or communities').' ');
} else {
- $r->print(''.&mt('Currently no active roles, courses or communities').' ');
+ if ($show_course) {
+ if ($env{'user.domain'} eq 'gcitest') {
+ $r->print(''.&mt('Currently no active Concept Tests').' ');
+ } else {
+ $r->print(''.&mt('Currently no active courses or communities').' ');
+ }
+ } else {
+ $r->print(''.&mt('Currently no active roles, courses or communities').' ');
+ }
}
unless ($env{'user.domain'} eq 'gcitest') {
&findcourse_advice($r);
@@ -815,7 +833,15 @@
}
$r->print('');
if ($countfuture) {
- $r->print(&mt('The following [quant,_1,role,roles] will become active in the future:',$countfuture));
+ if ($show_course) {
+ if ($env{'user.domain'} eq 'gcitest') {
+ $r->print(&mt('The following [quant,_1,Concept Test] will be available in the future:',$countfuture));
+ } else {
+ $r->print(&mt('The following [quant,_1,course] will become active in the future:',$countfuture));
+ }
+ } else {
+ $r->print(&mt('The following [quant,_1,role,roles] will become active in the future:',$countfuture));
+ }
my $doheaders = &roletable_headers($r,\%roleclass,\%sortrole,
$nochoose);
&print_rolerows($r,$doheaders,\%roleclass,\%sortrole,\%dcroles,
@@ -864,7 +890,7 @@
}
}
# ----------------------------------------------------------------------- Table
- unless ((!&Apache::loncommon::show_course()) || ($nochoose) || ($countactive==1)) {
+ unless ((!$show_course) || ($nochoose) || ($countactive==1)) {
$r->print("".&mt('Select a Course to Enter')." \n");
}
if ($env{'form.destinationurl'}) {
From raeburn@source.lon-capa.org Thu Oct 7 15:41:49 2010
From: raeburn@source.lon-capa.org (raeburn)
Date: Thu, 07 Oct 2010 14:41:49 -0000
Subject: [LON-CAPA-cvs] cvs: loncom /interface coursecatalog.pm
Message-ID:
raeburn Thu Oct 7 14:41:49 2010 EDT
Modified files:
/loncom/interface coursecatalog.pm
Log:
- Bug 6381.
Index: loncom/interface/coursecatalog.pm
diff -u loncom/interface/coursecatalog.pm:1.64 loncom/interface/coursecatalog.pm:1.65
--- loncom/interface/coursecatalog.pm:1.64 Tue Sep 7 03:00:38 2010
+++ loncom/interface/coursecatalog.pm Thu Oct 7 14:41:49 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler for displaying the course catalog interface
#
-# $Id: coursecatalog.pm,v 1.64 2010/09/07 03:00:38 raeburn Exp $
+# $Id: coursecatalog.pm,v 1.65 2010/10/07 14:41:49 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -395,7 +395,7 @@
$catlinks .= ''.&mt('De-select').' ';
for (my $j=0; $j<@{$cats[$shallower]{$container}}; $j++) {
my $name = $cats[$shallower]{$container}[$j];
- my $item = &escape($name).':'.$container.':'.$shallower;
+ my $item = &escape($name).':'.&escape($container).':'.$shallower;
my $selected = '';
if ($item eq $env{'form.currcat_'.$shallower}) {
$selected = ' selected="selected"';
From raeburn@source.lon-capa.org Thu Oct 7 16:39:27 2010
From: raeburn@source.lon-capa.org (raeburn)
Date: Thu, 07 Oct 2010 15:39:27 -0000
Subject: [LON-CAPA-cvs] cvs: loncom(GCI_3) /interface lonmenu.pm
Message-ID:
raeburn Thu Oct 7 15:39:27 2010 EDT
Modified files: (Branch: GCI_3)
/loncom/interface lonmenu.pm
Log:
- Customization for GCI_3.
- Home link in primary menu only shown to GCI Faculty
- Roles link in primary menu
- Skip all but first link in secondary menu unless in course or CSTR.
- No "Return to Last Location" unless in course.
- Backport 1.339.
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.309.2.16 loncom/interface/lonmenu.pm:1.309.2.17
--- loncom/interface/lonmenu.pm:1.309.2.16 Mon Oct 4 23:00:46 2010
+++ loncom/interface/lonmenu.pm Thu Oct 7 15:39:27 2010
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.309.2.16 2010/10/04 23:00:46 raeburn Exp $
+# $Id: lonmenu.pm,v 1.309.2.17 2010/10/07 15:39:27 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -183,9 +183,9 @@
next if $$menuitem[4] eq 'gci'
&& (!$custommenu || $env{'request.role'} =~ m{^st\./gcitest/});
next if $$menuitem[4] eq 'home'
- && $custommenu;
+ && (($custommenu) || ($env{'user.domain'} eq 'gcitest'));
next if $$menuitem[4] eq 'gcitest'
- && $env{'user.domain'} eq 'gci';
+ && (($env{'user.domain'} eq 'gci') || ($env{'request.role'} eq 'cm'));
next if $$menuitem[4] eq 'roles' # hide links which are
&& $custommenu; # not visible when GCI
next if $$menuitem[4] eq 'courses' # tabbed interface in use
@@ -224,11 +224,15 @@
$env{'course.' . $env{'request.course.id'} . '.num'});
my $custommenu = &Apache::loncommon::needs_gci_custom();
my $numdc = &Apache::loncommon::check_for_gci_dc();
+ my $role = $env{'request.role'};
foreach my $menuitem (@secondary_menu) {
# evaluate conditions
next if ref($menuitem) ne 'ARRAY';
next if $$menuitem[4] eq 'showmenu'
- && ($custommenu || !$numdc);
+ && ($custommenu || (!$numdc && $role eq 'cm'));
+ next if $$menuitem[4] ne 'showmenu'
+ && $$menuitem[4] ne 'author'
+ && !$env{'request.course.id'};
next if $$menuitem[4] eq 'showreturn'
&& !$showlink
&& !($env{'request.state'} eq 'construct');
@@ -250,7 +254,7 @@
&& !$canviewgrps
&& !%groups;
next if $$menuitem[4] eq 'showroles'
- && ($custommenu || !$numdc);
+ && ($custommenu || !$numdc || ($numdc && $env{'request.noversionuri'} eq '/adm/roles'));
if ($$menuitem[3] eq 'Roles' && $env{'request.course.id'} && !$custommenu) {
# special treatment for role selector
my $roles_selector = &roles_selector(
@@ -529,6 +533,7 @@
}
sub show_return_link {
+ return unless ($env{'request.course.id'});
if (($env{'request.noversionuri'} =~ m{^/adm/(viewclasslist|navmaps)($|\?)})
|| ($env{'request.noversionuri'} =~ m{^/adm/.*/aboutme($|\?)})) {
return if ($env{'form.register'});
@@ -2333,7 +2338,7 @@
secok = 0;
var numrolesec = rolesections[selidx].length;
var msgidx = numsec[selidx] - numrolesec;
- secchoice = prompt("$lt{'this'} "+secpick[msgidx]+"\\n$lt{'avai'} "+roleseclist[selidx],"");
+ secchoice = prompt("$lt{'this'}\\n"+secpick[msgidx]+"\\n$lt{'avai'} "+roleseclist[selidx],"");
if (secchoice == '') {
if (msgidx > 0) {
secok = 1;