@@ -272,8 +272,8 @@ def list_test_candidates(self,test_id, fields=None, filters=None):
272
272
273
273
def invite_test_candidate (self ,test_id ,fullname ,email ,msg = "" ,template = None ,send_email = True ,tags = None ,addtime = 0 ):
274
274
arglist = [('email' ,email ),
275
- ('send_email' ,send_email )]
276
- # ('send_email','true' if send_email else 'false' )]
275
+ ('send_email' ,'true' if send_email else 'false' )]
276
+ # ('send_email',send_email)]
277
277
if fullname :
278
278
arglist .append (('full_name' ,fullname ))
279
279
if msg and msg != '' :
@@ -287,7 +287,7 @@ def invite_test_candidate(self,test_id,fullname,email,msg="",template=None,send_
287
287
arglist .append (('accommodations' ,'{"additional_time_percent":' + str (addtime )+ '}' ))
288
288
return self .post ('tests/{}/candidates' .format (test_id ),arglist )
289
289
290
- def get_all_test_scores (self ,test_id ,include_incomplete = False ,filters = None ):
290
+ def get_all_test_scores (self ,test_id ,all_questions = True , include_incomplete = False ,filters = None ):
291
291
c_info = self .list_test_candidates (test_id ,filters = filters )
292
292
scores = []
293
293
all_qs = set ()
@@ -312,9 +312,9 @@ def get_all_test_scores(self,test_id,include_incomplete=False,filters=None):
312
312
percent = cand ['percentage_score' ]
313
313
questions = cand ['questions' ]
314
314
for q in all_qs :
315
- if q not in questions :
315
+ if q not in questions and all_questions :
316
316
questions [q ] = '0'
317
- elif questions [q ] == int (questions [q ]):
317
+ elif q in questions and questions [q ] == int (questions [q ]):
318
318
questions [q ] = int (questions [q ])
319
319
plag = cand ['plagiarism' ] if cand ['plagiarism_status' ] == True else None
320
320
scores += [{'id' : id , 'fullname' : fullname , 'email' : email , 'andrew' : andrew , 'score' : score ,
@@ -437,7 +437,7 @@ def late_score(score, late_penalty):
437
437
438
438
def feedback (self , q_info , late_penalty ):
439
439
if not q_info :
440
- return '\t 0\t --total-- (missing or not yet submitted)'
440
+ return '\t 0\t --total-- (not yet submitted)'
441
441
fb = ''
442
442
total = 0.0
443
443
for q_num in q_info :
@@ -713,6 +713,11 @@ def display_test_candidates(args, t_id):
713
713
hr = HackerRank (verbose = args .verbose )
714
714
c_list = hr .list_test_candidates (t_id )
715
715
for c in c_list :
716
+ if args .starttime :
717
+ if 'attempt_starttime' in c :
718
+ print (c ['attempt_starttime' ],end = '\t ' )
719
+ else :
720
+ print ('---\t ' )
716
721
fname = c ['full_name' ] if 'full_name' in c else '{unknown}'
717
722
andrew = HackerRank .get_Andrew_ID (c )
718
723
plag = '**' if 'plagiarism_status' in c and c ['plagiarism_status' ] else ''
@@ -744,7 +749,7 @@ def display_score_details(args, t_id, c_id):
744
749
for q in questions :
745
750
# cache the question names
746
751
hr .get_question_name (q )
747
- print ('{}{} ({}) @ {}' .format (fname ,andrew ,c_info ['email' ],c_info ['attempt_endtime' ]))
752
+ print ('{}{} ({}) @ {}-{} ' .format (fname ,andrew ,c_info ['email' ], c_info [ 'attempt_starttime ' ],c_info ['attempt_endtime' ]))
748
753
for q in questions :
749
754
print ('\t {}\t {}' .format (questions [q ],hr .get_question_name (q )))
750
755
print ('{}%\t {}\t Total' .format (percent ,c_info ['score' ]))
@@ -930,6 +935,7 @@ def parse_arguments(flag_adder = None):
930
935
parser .add_argument ("-T" ,"--listtests" ,action = "store_true" ,help = "list available tests" )
931
936
parser .add_argument ("-t" ,"--showtest" ,action = "store_true" ,help = "display details of a test" )
932
937
parser .add_argument ("-c" ,"--listcandidates" ,action = "store_true" ,help = "display list of candidates taking test" )
938
+ parser .add_argument ("--starttime" ,action = "store_true" ,help = "add attempt start time to candidate listing" )
933
939
parser .add_argument ("-C" ,"--candidatedetails" ,action = "store_true" ,help = "display detailed results of candidates taking test" )
934
940
parser .add_argument ("-S" ,"--testscore" ,action = "store_true" ,help = "display detailed score on test T by candidate C" )
935
941
parser .add_argument ("-P" ,"--plagiarism" ,action = "store_true" ,help = "analyze plagiarism flags for test" )
0 commit comments