% TAM 2020 Final Grades - Fall 2010
% version 4.0,  Dec 11, 2010   edited by Andy Ruina
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This m-file reads student grades into Matlab from Excel file.          
% Student information is stored in a cell array, while all other numerical 
% data is stored in double arrays.


% cols 
% 1 -14: Homework, out of 10, max ~12
% 15-17: Labs, out of 15, max ~16
% 18-35: Prelims
%    18 = q1
%    19 = q1 regrade (possibly 0, max = 25)
%    20 = q2
%    21 = q2 regrade (possibly 0, max = 25)
%    22 = q3 
%    23 = q3 regrade (possibly 0, max = 25)
%    24 = q4 
%    25 = q4 regrade (possibly 0, max = 20)
%    26 = q5
%    27 = q5 regrade (possibly 0, max = 20)
%    28 = q6 
%    29 = q6 regrade (possibly 0, max = 20)
%    30 = q7 
%    31 = q7 regrade (possibly 0, max = 20)
%    32 = q8 
%    33 = q8 regrade (possibly 0, max = 20)
%    34 = q9 
%    35 = q9 regrade (possibly 0, max = 20)
%    
% 36-40 Final exam, out of 25, max = 26
% 41    Homework exam  out of 4
% 42    Bonus, 25 max
% 43    i-clicker
% 44    course survey

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear; %clc;
disp(['Run started at: ' datestr(now)])

[data, names,raw] = xlsread('Raw_Grades_Fall_10fakenames'); % Read Excel file.

names      = char(names(:,1));  % Delete header row
names = names(2:end,:);


homeworks  = data(:,1:14);  % HOMEWORK GRADES
  homeworksmed = median(homeworks);
  homeworksmax = max(homeworks);

labs       = data(:,15:17); % Lab scores.
  labsmed = median(labs);
  labsmax  = max(labs);
prelimsraw    = data(:,18:35); % prelim scores, includes makeup
  prelimsrawmed  = median(prelimsraw);
  prelimsrawmax  = max(prelimsraw);
finalexam = data(:,36:40); % Extract final exam scores
  finalexammed = median(finalexam);
  finalexammax = max(finalexam);
hwexam     = data(:,41);    % Homework exam  (out of 4)
bonus      = data(:, 42);   % Bonus, projects, etc
  bonusmed  = median(bonus);
  bonusmax  = max(bonus);
clickerraw    = data(:,43);    % i-clicker, # days attended
  clickerrawmed = median(clickerraw);
  clickerrawmax = max(clickerraw);
survey     = data(:,44);    % Course survey point.
  surveymed = median(survey);
  surveymax = max(survey)
nstud =     length(prelimsraw(:,1));

disp(['Number of student scores =  ' num2str(nstud)])
disp(['Run complete at: ' datestr(now)])
disp(['*************************************************'])
