'.
''.
' Fullname (username) '.
@@ -2388,7 +2420,7 @@ LISTJAVASCRIPT
' Fullname (username) '.
' Fullname (username) ';
- my (undef,undef,$fullname) = &getclasslist($getsec,'0');
+ my (undef,undef,$fullname) = &getclasslist($getsec,'1');
my $ptr = 1;
foreach my $student (sort {lc($$fullname{$a}) cmp lc($$fullname{$b}) } keys %$fullname) {
my ($uname,$udom) = split(/:/,$student);
@@ -2412,8 +2444,8 @@ LISTJAVASCRIPT
}
sub getSymbMap {
- my $navmap = Apache::lonnavmaps::navmap-> new(
- $ENV{'request.course.fn'}.'.db',
+ my ($request) = @_;
+ my $navmap = Apache::lonnavmaps::navmap-> new($ENV{'request.course.fn'}.'.db',
$ENV{'request.course.fn'}.'_parms.db',1, 1);
my $res = $navmap->firstResource(); # temp resource to access constants
@@ -2434,10 +2466,32 @@ sub getSymbMap {
if ($curRes == $iterator->END_MAP()) { $depth--; }
if (ref($curRes) && $curRes->is_map()) {
- my $title = $curRes->compTitle();
- push @titles,$minder.'.'.$title; # minder, just in case two titles are identical
- $symbx{$minder.'.'.$title} = $curRes->symb();
- $minder++;
+ my ($mapUrl, $id, $resUrl) = split(/___/, $curRes->symb()); # check map contains at least one problem
+ my $map = $navmap->getResourceByUrl($resUrl); # add to navmaps
+
+ my $mapiterator = $navmap->getIterator($map->map_start(),
+ $map->map_finish());
+
+ my $mapdepth = 1;
+ my $countProblems = 0;
+ $mapiterator->next(); # skip the first BEGIN_MAP
+ my $mapcurRes = $mapiterator->next(); # for "current resource"
+ my $ctr=0;
+ while ($mapdepth > 0 && $ctr < 100) {
+ if($mapcurRes == $mapiterator->BEGIN_MAP) { $mapdepth++; }
+ if($mapcurRes == $mapiterator->END_MAP) { $mapdepth++; }
+
+ if (ref($mapcurRes) && $mapcurRes->is_problem() && !$mapcurRes->randomout) {
+ $countProblems++;
+ }
+ $ctr++;
+ }
+ if ($countProblems > 0) {
+ my $title = $curRes->compTitle();
+ push @titles,$minder.'.'.$title; # minder, just in case two titles are identical
+ $symbx{$minder.'.'.$title} = $curRes->symb();
+ $minder++;
+ }
}
$curRes = $iterator->next();
}
@@ -2446,23 +2500,27 @@ sub getSymbMap {
return \@titles,\%symbx;
}
+#
+#--- Displays a page/sequence w/wo problems, w/wo submissions
sub displayPage {
my ($request) = shift;
+ my ($symb,$url) = &get_symb_and_url($request);
my $cdom = $ENV{"course.$ENV{'request.course.id'}.domain"};
my $cnum = $ENV{"course.$ENV{'request.course.id'}.num"};
my $getsec = $ENV{'form.section'} eq '' ? 'all' : $ENV{'form.section'};
my $pageTitle = $ENV{'form.page'};
- my (undef,undef,$fullname) = &getclasslist($getsec,'0');
+ my (undef,undef,$fullname) = &getclasslist($getsec,'1');
my ($uname,$udom) = split(/:/,$ENV{'form.student'});
- my ($idx,$showtitle) = ($pageTitle =~ /(\d+)\.(.*)/);
my $result=' '.$ENV{'form.title'}.' ';
$result.=' Student: '.$$fullname{$ENV{'form.student'}}.
' ('.$uname.($udom eq $cdom ? '':':'.$udom).') '."\n";
- my $navmap = Apache::lonnavmaps::navmap-> new(
- $ENV{'request.course.fn'}.'.db',
+ &sub_page_js($request);
+ $request->print($result);
+
+ my $navmap = Apache::lonnavmaps::navmap-> new($ENV{'request.course.fn'}.'.db',
$ENV{'request.course.fn'}.'_parms.db',1, 1);
my ($mapUrl, $id, $resUrl) = split(/___/, $ENV{'form.page'});
my $map = $navmap->getResourceByUrl($resUrl); # add to navmaps
@@ -2470,163 +2528,660 @@ sub displayPage {
my $iterator = $navmap->getIterator($map->map_start(),
$map->map_finish());
- my $depth = 1;
+ my $studentTable='
+$grading_menu_button
+SCANTRONFORM
+
+ return $result;
+}
+
+sub scantron_configphase {
+ my ($r) = @_;
+ my (undef,undef,$sequence)=split(/___/,$ENV{'form.selectpage'});
+ my $result;
+ my ($symb,$url)=&get_symb_and_url($r);
+ if (!$symb) {return '';}
+ my $default_form_data=&defaultFormData($symb,$url);
+ my $grading_menu_button=&show_grading_menu_form($symb,$url);
+ my $file_selector;
+ $result.= <
+
+ $default_form_data
+
+
+
+
+
+
+ Select a format for the data file.
+
+
+
+
+ Format of data file:
+
+
+
+
+ Filename of scoring office file: $file_selector
+
+
+
+
+
+
+
+
+$grading_menu_button
+SCANTRONFORM
+ #FIXME Needs to present some lines from the file and allow the instructor to specify which columns represent what data, possibly have some nice defaults setup, probably should do a pass through all problems for a student to get an idea of how many questions there are, and homw many lines we'll have,
+ return $result;
+}
- my $hostver=unpack("%32C*",$Apache::lonnet::perlvar{'lonHostID'});
+sub scantron_process_students {
+ #FIXME
+ # loop through students, {
+ # Check if studnet info valid, if not add line to delay queue
+ # foreach question 'submit' the students answer to the server
+ # through grade target {
+ # generate data to pass back that includes grade recevied
+ # }
+ # }
+ # loop through delay queue {
+ # print out each delayed student with interface to select how
+ # to repair student provided info
+ # Expected errors include
+ # 1 bad/no stuid/username
+ # 2 invalid bubblings
+ # }
+ # if delay queue exists 2 submits one to process delayed students one
+ # to ignore delayed students, possibly saving the delay queue for later
- $result.=''."\n";
- $result.=''."\n";
- $result.='
'."\n";
+
+ function checkReceiptNo(formname,nospace) {
+ var receiptNo = formname.receipt.value;
+ var checkOpt = false;
+ if (nospace == "OK" && isNaN(receiptNo)) {checkOpt = true;}
+ if (nospace == "notOK" && (isNaN(receiptNo) || receiptNo == "")) {checkOpt = true;}
+ if (checkOpt) {
+ alert("Please enter a receipt number given by a student in the receipt box.");
+ formname.receipt.value = "";
+ formname.receipt.focus();
+ return false;
+ }
+ formname.command[5].checked = true;
+ return true;
+ }
+
+ function radioSelection(radioButton) {
+ var selection=null;
+ if (radioButton.length > 1) {
+ for (var i=0; i 1) {
+ for (var i=0; i");
+ lDoc.write("Browse And Upload ");
+
+ lDoc.write("
+GRADINGMENUJS
+
+ my $result=' Manual Grading/View Submission '.
+ ''.
+ 'Problem: '.$probTitle.' '."\n";
+ my ($partlist,$handgrade) = &response_type($url);
+ my ($resptype,$hdgrade)=('','no');
+ for (sort keys(%$handgrade)) {
+ my ($responsetype,$handgrade)=split(/:/,$$handgrade{$_});
+ $resptype = $responsetype;
+ $hdgrade = $handgrade if ($handgrade eq 'yes');
+ $result.='Part '.(split(/_/))[0].' '.
+ 'Type: '.$responsetype.' '.
+ 'Handgrade: '.$handgrade.' ';
+ }
+ $result.='
'."\n";
+
+ my (undef,$sections) = &getclasslist('all','0');
+ my $savedState = &savedState();
+ my $saveCmd = ($$savedState{'saveCmd'} eq '' ? 'pickStudentPage' : $$savedState{'saveCmd'});
+ my $saveSec = ($$savedState{'saveSec'} eq '' ? 'all' : $$savedState{'saveSec'});
+ my $saveSub = ($$savedState{'saveSub'} eq '' ? 'yes' : $$savedState{'saveSub'});
+ my $saveStatus = ($$savedState{'saveStatus'} eq '' ? 'Active' : $$savedState{'saveStatus'});
+
+ $result.=''."\n".
+ ' '."\n".
+ ' '."\n".
+ ' '."\n".
+ ' '."\n".
+ ' '."\n".
+ ' '."\n".
+ ' '."\n";
+
+ $result.=''."\n".
+ ''."\n".
+ ' Select a Grading/Viewing Option '."\n".
+ ''."\n";
+
+ $result.=''."\n".
+ '
'."\n".
+ '
'."\n";
return $result;
}
@@ -2681,13 +3236,12 @@ sub handler {
$Apache::grades::viewgrades=&Apache::lonnet::allowed('vgr',$ENV{'request.course.id'});
if ($command eq 'submission') {
($ENV{'form.student'} eq '' ? &listStudents($request) : &submission($request,0,0));
-# if ($command eq 'submission') {
-# &listStudents($request) if ($ENV{'form.student'} eq '');
-# &submission($request,0,0) if ($ENV{'form.student'} ne '');
} elsif ($command eq 'pickStudentPage') {
&pickStudentPage($request);
} elsif ($command eq 'displayPage') {
&displayPage($request);
+ } elsif ($command eq 'gradeByPage') {
+ &updateGradeByPage($request);
} elsif ($command eq 'processGroup') {
&processGroup($request);
} elsif ($command eq 'gradingmenu') {
@@ -2700,6 +3254,8 @@ sub handler {
$request->print(&editgrades($request));
} elsif ($command eq 'verify') {
$request->print(&verifyreceipt($request));
+ } elsif ($command eq 'csvform') {
+ $request->print(&upcsvScores_form($request));
} elsif ($command eq 'csvupload') {
$request->print(&csvupload($request));
} elsif ($command eq 'viewclasslist') {
@@ -2717,6 +3273,10 @@ sub handler {
}
$request->print(&csvuploadmap($request));
}
+ } elsif ($command eq 'scantron_selectphase') {
+ $request->print(&scantron_selectphase($request));
+ } elsif ($command eq 'scantron_configphase') {
+ $request->print(&scantron_configphase($request));
} else {
$request->print("Unknown action: $command:");
}