version 1.565, 2016/08/08 18:19:16
|
version 1.567, 2016/10/15 14:02:43
|
Line 371 sub endSettingsScreen {
|
Line 371 sub endSettingsScreen {
|
# (parmval is also used for the log of parameter changes) |
# (parmval is also used for the log of parameter changes) |
################################################## |
################################################## |
|
|
# Calls parmval_by_symb, getting the symb from $id (the big hash resource id) with &symbcache. |
# Calls parmval_by_symb, getting the symb from $id with &symbcache. |
# |
# |
# @param {string} $what - part info and parameter name separated by a dot, e.g. '0.weight' |
# @param {string} $what - part info and parameter name separated by a dot, e.g. '0.weight' |
# @param {string} $id - big hash resource id |
# @param {string} $id - resource id or map pc |
# @param {string} $def - the resource's default value for this parameter |
# @param {string} $def - the resource's default value for this parameter |
# @param {string} $uname - user name |
# @param {string} $uname - user name |
# @param {string} $udom - user domain |
# @param {string} $udom - user domain |
Line 394 sub parmval {
|
Line 394 sub parmval {
|
# (level 1 is the most specific and will have precedence) |
# (level 1 is the most specific and will have precedence) |
# |
# |
# @param {string} $what - part info and parameter name separated by a dot, e.g. '0.weight' |
# @param {string} $what - part info and parameter name separated by a dot, e.g. '0.weight' |
# @param {string} $symb - resource symb |
# @param {string} $symb - resource symb or map src |
# @param {string} $def - the resource's default value for this parameter |
# @param {string} $def - the resource's default value for this parameter |
# @param {string} $uname - user name |
# @param {string} $uname - user name |
# @param {string} $udom - user domain |
# @param {string} $udom - user domain |
Line 597 sub reset_caches {
|
Line 597 sub reset_caches {
|
} |
} |
} |
} |
|
|
# cache big hash id -> symb, using lonnavmaps to find association |
# cache resource id or map pc -> resource symb or map src, using lonnavmaps to find association |
{ |
{ |
my $symbsid; # course identifier, to initialize the cache only once for a course |
my $symbsid; # course identifier, to initialize the cache only once for a course |
my %symbs; # hash id->symb |
my %symbs; # hash id->symb |
Line 607 sub reset_caches {
|
Line 607 sub reset_caches {
|
undef(%symbs); |
undef(%symbs); |
} |
} |
|
|
# returns the symb corresponding to a big hash id (using lonnavmaps and a cache) |
# returns the resource symb or map src corresponding to a resource id or map pc |
|
# (using lonnavmaps and a cache) |
sub symbcache { |
sub symbcache { |
my $id=shift; |
my $id=shift; |
if ($symbsid ne $env{'request.course.id'}) { |
if ($symbsid ne $env{'request.course.id'}) { |
Line 718 sub date_sanity_info {
|
Line 719 sub date_sanity_info {
|
|
|
# Store a parameter value and type by ID, also triggering more parameter changes based on parameter default actions. |
# Store a parameter value and type by ID, also triggering more parameter changes based on parameter default actions. |
# |
# |
# @param {string} $sresid - resource big hash id |
# @param {string} $sresid - resource id or map pc |
# @param {string} $spnam - part info and parameter name separated by a dot or underscore, e.g. '0.weight' |
# @param {string} $spnam - part info and parameter name separated by a dot or underscore, e.g. '0.weight' |
# @param {integer} $snum - level |
# @param {integer} $snum - level |
# @param {string} $nval - new value |
# @param {string} $nval - new value |
Line 737 my %recstack; # hash parameter name -> 1
|
Line 738 my %recstack; # hash parameter name -> 1
|
# Store a parameter value and type by symb, also triggering more parameter changes based on parameter default actions. |
# Store a parameter value and type by symb, also triggering more parameter changes based on parameter default actions. |
# Uses storeparm_by_symb_inner to actually store the parameter, ignoring any returned error. |
# Uses storeparm_by_symb_inner to actually store the parameter, ignoring any returned error. |
# |
# |
# @param {string} $symb - resource symb |
# @param {string} $symb - resource symb or map src |
# @param {string} $spnam - part info and parameter name separated by a dot or underscore, e.g. '0.weight' |
# @param {string} $spnam - part info and parameter name separated by a dot or underscore, e.g. '0.weight' |
# @param {integer} $snum - level |
# @param {integer} $snum - level |
# @param {string} $nval - new value |
# @param {string} $nval - new value |
Line 807 sub log_parmset {
|
Line 808 sub log_parmset {
|
# Store a parameter value and type by symb, without using the parameter default actions. |
# Store a parameter value and type by symb, without using the parameter default actions. |
# Expire related sheets. |
# Expire related sheets. |
# |
# |
# @param {string} $symb - resource symb |
# @param {string} $symb - resource symb or map src |
# @param {string} $spnam - part info and parameter name separated by a dot, e.g. '0.weight' |
# @param {string} $spnam - part info and parameter name separated by a dot, e.g. '0.weight' |
# @param {integer} $snum - level |
# @param {integer} $snum - level |
# @param {string} $nval - new value |
# @param {string} $nval - new value |
Line 1364 ENDHEAD
|
Line 1365 ENDHEAD
|
# @param {string} $which - parameter key ('parameter_'.part.'_'.name) |
# @param {string} $which - parameter key ('parameter_'.part.'_'.name) |
# @param {hash reference} $part - parameter key -> parameter part (can be problem part.'_'.response id for response parameters) |
# @param {hash reference} $part - parameter key -> parameter part (can be problem part.'_'.response id for response parameters) |
# @param {hash reference} $name - parameter key -> parameter name |
# @param {hash reference} $name - parameter key -> parameter name |
# @param {hash reference} $symbp - resource id -> symb |
# @param {hash reference} $symbp - map pc or resource/map id -> map src.'___(all)' or resource symb |
# @param {string} $rid - resource id |
# @param {string} $rid - resource id |
# @param {hash reference} $default - parameter key -> resource parameter default value |
# @param {hash reference} $default - parameter key -> resource parameter default value |
# @param {hash reference} $defaulttype - parameter key -> resource parameter default type |
# @param {hash reference} $defaulttype - parameter key -> resource parameter default type |
Line 1650 sub parm_control_group {
|
Line 1651 sub parm_control_group {
|
# Extracts lots of information about all of the the course's resources into a variety of hashes, using lonnavmaps and lonnet::metadata. |
# Extracts lots of information about all of the the course's resources into a variety of hashes, using lonnavmaps and lonnet::metadata. |
# All the parameters are references and are filled by the sub. |
# All the parameters are references and are filled by the sub. |
# |
# |
# @param {array reference} $ids - resource ids |
# @param {array reference} $ids - resource and map ids |
# @param {hash reference} $typep - hash resource id (from big hash) -> resource type (file extension) |
# @param {hash reference} $typep - hash resource/map id -> resource type (file extension) |
# @param {hash reference} $keyp - hash resource id -> comma-separated list of parameter keys from lonnet::metadata |
# @param {hash reference} $keyp - hash resource/map id -> comma-separated list of parameter keys from lonnet::metadata |
# @param {hash reference} $allparms - hash parameter name -> parameter title |
# @param {hash reference} $allparms - hash parameter name -> parameter title |
# @param {hash reference} $allparts - hash parameter part -> part title (a parameter part can be problem part.'_'.response id for response parameters) |
# @param {hash reference} $allparts - hash parameter part -> part title (a parameter part can be problem part.'_'.response id for response parameters) |
# @param {hash reference} $allmaps - hash map id (from big hash) -> map src |
# @param {hash reference} $allmaps - hash map pc -> map src |
# @param {hash reference} $mapp - hash resource id -> enclosing map src |
# @param {hash reference} $mapp - hash map pc or resource/map id -> enclosing map src |
# @param {hash reference} $symbp - hash map id or resource id -> map src.'___(all)' for a map or resource symb for a resource |
# @param {hash reference} $symbp - hash map pc or resource/map id -> map src.'___(all)' for a map or resource symb for a resource |
# @param {hash reference} $maptitles - hash map id or src -> map title (this should really be two separate hashes) |
# @param {hash reference} $maptitles - hash map pc or src -> map title (this should really be two separate hashes) |
# @param {hash reference} $uris - hash resource id -> resource src |
# @param {hash reference} $uris - hash resource/map id -> resource src |
# @param {hash reference} $keyorder - hash parameter key -> appearance rank for this parameter when looking through every resource and every parameter, starting at 100 (integer) |
# @param {hash reference} $keyorder - hash parameter key -> appearance rank for this parameter when looking through every resource and every parameter, starting at 100 (integer) |
# @param {hash reference} $defkeytype - hash parameter name -> parameter type |
# @param {hash reference} $defkeytype - hash parameter name -> parameter type |
sub extractResourceInformation { |
sub extractResourceInformation { |
Line 2260 sub displaymenu {
|
Line 2261 sub displaymenu {
|
# Used by table mode and overview mode. |
# Used by table mode and overview mode. |
# |
# |
# @param {Apache2::RequestRec} $r - the Apache request |
# @param {Apache2::RequestRec} $r - the Apache request |
# @param {hash reference} $allmaps - hash map id -> map src |
# @param {hash reference} $allmaps - hash map pc -> map src |
# @param {string} $pschp - selected map id, or 'all' |
# @param {string} $pschp - selected map pc, or 'all' |
# @param {hash reference} $maptitles - hash map id or src -> map title |
# @param {hash reference} $maptitles - hash map id or src -> map title |
# @param {hash reference} $symbp - hash map id or resource id -> map src.'___(all)' for a map or resource symb for a resource |
# @param {hash reference} $symbp - hash map pc or resource/map id -> map src.'___(all)' or resource symb |
sub mapmenu { |
sub mapmenu { |
my ($r,$allmaps,$pschp,$maptitles,$symbp)=@_; |
my ($r,$allmaps,$pschp,$maptitles,$symbp)=@_; |
my %allmaps_inverted = reverse %$allmaps; |
my %allmaps_inverted = reverse %$allmaps; |
Line 2619 sub standardkeyorder {
|
Line 2620 sub standardkeyorder {
|
# pres_value - &&&-separated parameter values |
# pres_value - &&&-separated parameter values |
# prevvisit - '1' if the user has submitted the form before |
# prevvisit - '1' if the user has submitted the form before |
# pscat (multiple values) - selected parameter names |
# pscat (multiple values) - selected parameter names |
# pschp - selected map id, or 'all' |
# pschp - selected map pc, or 'all' |
# psprt (multiple values) - list of selected parameter parts |
# psprt (multiple values) - list of selected parameter parts |
# filter - part of or whole parameter name, to be filtered out when parameters are displayed (unused ?) |
# filter - part of or whole parameter name, to be filtered out when parameters are displayed (unused ?) |
# recent_* (* = parameter type) - recent values entered by the user for parameter types |
# recent_* (* = parameter type) - recent values entered by the user for parameter types |
Line 2635 sub assessparms {
|
Line 2636 sub assessparms {
|
|
|
|
|
# -------------------------------------------------------- Variable declaration |
# -------------------------------------------------------- Variable declaration |
my @ids=(); # resource ids |
my @ids=(); # resource and map ids |
my %symbp=(); # hash map id or resource id -> map src.'___(all)' for a map or resource symb for a resource |
my %symbp=(); # hash map pc or resource/map id -> map src.'___(all)' or resource symb |
my %mapp=(); # hash resource id -> enclosing map src |
my %mapp=(); # hash map pc or resource/map id -> enclosing map src |
my %typep=(); # hash resource id (from big hash) -> resource type (file extension) |
my %typep=(); # hash resource/map id -> resource type (file extension) |
my %keyp=(); # hash resource id -> comma-separated list of parameter keys |
my %keyp=(); # hash resource/map id -> comma-separated list of parameter keys |
my %uris=(); # hash resource id -> resource src |
my %uris=(); # hash resource/map id -> resource src |
my %maptitles=(); # hash map id or src -> map title |
my %maptitles=(); # hash map pc or src -> map title |
my %allmaps=(); # hash map id (from big hash) -> map src |
my %allmaps=(); # hash map pc -> map src |
my %alllevs=(); # hash English level title -> value |
my %alllevs=(); # hash English level title -> value |
|
|
my $uname; # selected user name |
my $uname; # selected user name |
Line 4139 sub string_ip_selector {
|
Line 4140 sub string_ip_selector {
|
@{$access{'deny'}} = (''); |
@{$access{'deny'}} = (''); |
} |
} |
my ($disabled,$addmore); |
my ($disabled,$addmore); |
if ($disabled) { |
if ($readonly) { |
$disabled=' disabled="disabled"'; |
$disabled=' disabled="disabled"'; |
} else { |
} else { |
$addmore = "\n".'<button class="LC_add_ipacc_button">'.&mt('Add more').'</button>'; |
$addmore = "\n".'<button class="LC_add_ipacc_button">'.&mt('Add more').'</button>'; |
Line 4560 sub date_interval_selector {
|
Line 4561 sub date_interval_selector {
|
$currprocdisplay = 'text'; |
$currprocdisplay = 'text'; |
} |
} |
my $onclick = ' onclick="toggleSecret(this.form,'."'done_','$thiskey'".');"'; |
my $onclick = ' onclick="toggleSecret(this.form,'."'done_','$thiskey'".');"'; |
|
my $disabled; |
|
if ($readonly) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
$result .= '<br /><span class="LC_nobreak">'.&mt('Include "done" button'). |
$result .= '<br /><span class="LC_nobreak">'.&mt('Include "done" button'). |
'<label><input type="radio" value="" name="done_'.$thiskey.'"'.$checkedoff.$onclick.' />'. |
'<label><input type="radio" value="" name="done_'.$thiskey.'"'.$checkedoff.$onclick.$disabled.' />'. |
&mt('No').'</label>'.(' 'x2). |
&mt('No').'</label>'.(' 'x2). |
'<label><input type="radio" value="_done" name="done_'.$thiskey.'"'.$checkedon.$onclick.' />'. |
'<label><input type="radio" value="_done" name="done_'.$thiskey.'"'.$checkedon.$onclick.$disabled.' />'. |
&mt('Yes').'</label>'.(' 'x2). |
&mt('Yes').'</label>'.(' 'x2). |
'<label><input type="radio" value="_done_proctor" name="done_'.$thiskey.'"'.$checkedproc.$onclick.' />'. |
'<label><input type="radio" value="_done_proctor" name="done_'.$thiskey.'"'.$checkedproc.$onclick.$disabled.' />'. |
&mt('Yes, with proctor key').'</label>'. |
&mt('Yes, with proctor key').'</label>'. |
'<input type="'.$currprocdisplay.'" id="done_'.$thiskey.'_proctorkey" '. |
'<input type="'.$currprocdisplay.'" id="done_'.$thiskey.'_proctorkey" '. |
'name="done_'.$thiskey.'_proctorkey" value="'.&HTML::Entities::encode($currproctorkey,'"<>&').'" /></span><br />'. |
'name="done_'.$thiskey.'_proctorkey" value="'.&HTML::Entities::encode($currproctorkey,'"<>&').'"'.$disabled.' /></span><br />'. |
'<span class="LC_nobreak">'.&mt('Button text').': '. |
'<span class="LC_nobreak">'.&mt('Button text').': '. |
'<input type="text" name="done_'.$thiskey.'_buttontext" value="'.&HTML::Entities::encode($currdonetext,'"<>&').'" /></span>'; |
'<input type="text" name="done_'.$thiskey.'_buttontext" value="'.&HTML::Entities::encode($currdonetext,'"<>&').'"'.$disabled.' /></span>'; |
} |
} |
} |
} |
unless ($readonly) { |
unless ($readonly) { |
Line 4881 ENDOVER
|
Line 4886 ENDOVER
|
# The non-type value is always 1. |
# The non-type value is always 1. |
# |
# |
# @param {string} $cat - parameter name |
# @param {string} $cat - parameter name |
# @param {string} $pschp - selected map id, or 'all' |
# @param {string} $pschp - selected map pc, or 'all' |
# @param {string} $parmlev - selected level value (full|map|general), or '' |
# @param {string} $parmlev - selected level value (full|map|general), or '' |
# @param {hash reference} $listdata - the parameter data that will be modified |
# @param {hash reference} $listdata - the parameter data that will be modified |
# @param {array reference} $psprt - selected parts |
# @param {array reference} $psprt - selected parts |
# @param {array reference} $selections - selected sections |
# @param {array reference} $selections - selected sections |
# @param {hash reference} $defkeytype - hash parameter name -> parameter type |
# @param {hash reference} $defkeytype - hash parameter name -> parameter type |
# @param {hash reference} $allmaps - hash map id -> map src |
# @param {hash reference} $allmaps - hash map pc -> map src |
# @param {array reference} $ids - resource ids |
# @param {array reference} $ids - resource and map ids |
# @param {hash reference} $symbp - hash map id or resource id -> map src.'___(all)' for a map or resource symb for a resource |
# @param {hash reference} $symbp - hash map pc or resource/map id -> map src.'___(all)' or resource symb |
sub secgroup_lister { |
sub secgroup_lister { |
my ($cat,$pschp,$parmlev,$listdata,$psprt,$selections,$defkeytype,$allmaps,$ids,$symbp) = @_; |
my ($cat,$pschp,$parmlev,$listdata,$psprt,$selections,$defkeytype,$allmaps,$ids,$symbp) = @_; |
foreach my $item (@{$selections}) { |
foreach my $item (@{$selections}) { |