# Handin-server time stamp

**URL:** <https://racket.discourse.group/t/handin-server-time-stamp/1736>\
**Category:** Show & Tell\
**Tags:** handin\
**Created:** [February 25, 2023, 9:05pm UTC](https://racket.discourse.group/t/handin-server-time-stamp/1736 "2023-02-25T21:05:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbclements](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/jbclements/32/11_2.png) [@jbclements](https://racket.discourse.group/u/jbclements)\
**Post date:** [February 25, 2023, 9:05pm UTC](https://racket.discourse.group/t/handin-server-time-stamp/1736/1 "2023-02-25T21:05:45Z")

</div>

Okay, this is incredibly obvious, but it had never occurred to me before today to timestamp handin submissions as they arrive. Specifically, adding this to the `check:` block:

```scheme
   (define timestamp-string
     (parameterize ([date-display-format 'rfc2822])
       (date->string (seconds->date (current-seconds) #t) #t)))        
   (add-header-line! (string-append "timestamp: " timestamp-string))

```

(... and adding `(require racket/date)` at the top of the file, of course)

---

<div class="post-metadata">

**Author:** ![bremner](https://avatars.discourse-cdn.com/v4/letter/b/aca169/32.png) [@bremner](https://racket.discourse.group/u/bremner)\
**Post date:** [February 28, 2023, 1:04pm UTC](https://racket.discourse.group/t/handin-server-time-stamp/1736/2 "2023-02-28T13:04:24Z")

</div>

John Clements via Racket Discussions  
[notifications@racket.discoursemail.com](mailto:notifications@racket.discoursemail.com) writes:

> Okay, this is incredibly obvious, but it had never occurred to me before today to timestamp handin submissions as they arrive. Specifically, adding this to the `check:` block:
> 
> ```scheme
> (define timestamp-string
> (parameterize ([date-display-format 'rfc2822])
> (date->string (seconds->date (current-seconds) #t) #t)))        
> (add-header-line! (string-append "timestamp: " timestamp-string))
> 
> ```
> 
> (... and adding `(require racket/date)` at the top of the file, of course)

Pardon the slightly offtopic question, but have you figured out how to  
prevent add-header-line! from generated wrapped lines? When I add a  
long line, it gets wrapped like

;;\> --\> while evaluating (run (quasiquote (let1 (x 1) (begin (set! x 2) x)))):  
parse-sx: parse error: `(set! x 2)

This is a bit of a bummer because it means the files have to be edited  
to become valid racket again.

d

---

<div class="post-metadata">

**Author:** ![jbclements](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/jbclements/32/11_2.png) [@jbclements](https://racket.discourse.group/u/jbclements)\
**Post date:** [March 3, 2023, 5:23am UTC](https://racket.discourse.group/t/handin-server-time-stamp/1736/3 "2023-03-03T05:23:14Z")

</div>

I _thought_ I had the problem that you described... but actually, the problem is subtly different, and I'm wondering whether this is your problem too. Consider the following lines from the beginning of a file I recently graded:

```scheme
;;> Maximum points for this assignment: <+100>
;;> Testfail: while evaluating (top-interp (quote (((empty) : (((cons) : (((empty?) : (((first) : (((rest) : (((Y) : (((length) : (((addup) : (addup (cons 3 (cons 17 empty)))) (Y ((addup) : ((l) : (if (empty? l) then 0 else (+ (first l) (addup (rest l))))))))) (Y ((length) : ((l) : (if (empty? l) then 0 else (+ 1 (length (rest l))))))))) (((x) : ((y) : (y ((z) : (((x x) y) z))))) ((x) : ((y) : (y ((z) : (((x x) y) z)))))))) ((l) : (l false)))) ((l) : (l true)))) ((l) : (equal? l empty)))) ((a b) : ((select) : (if select then a else b))))) 13))):
  lookup: IKEU | Name not found : ''cons
;;> Testfail: expected exception with message containing IKEU on test expression: '(parse '(let ((if = "")) "World"))

```

The third line here is not commented, and if I want to run the code, I have to go in and comment it myself.

Is this the problem you're referring to?

If so, I think the real issue here is not line wrap; instead, take a look at line #347 of checker.rkt:

> <https://github.com/racket/handin/blob/d5a3defd20243f81eeec17103742810584049eca/handin-server/checker.rkt#L347>

This code introduces a newline into the message, causing the problem above.

I think it would probably make sense to simply take this newline out, which would appear to solve the problem.

Thoughts?
