<commit_before>import { Map } from "immutable";

import { Component, React, Rendered } from "../../app-framework";

import { plural } from "smc-util/misc2";

import { CELLTYPE_INFO_MAP, state_to_value } from "./cell-types";

import { Tip } from "../../r_misc/tip";

interface Props {
  nbgrader: Map<string, any>;
  start?: number;
  state?: string;
  output?: Map<string, any>;
}

export class NBGraderMetadata extends Component<Props> {
  /*private is_correct(): boolean {
    // use heuristics to try to determine if they have successfully
    // validated their answer based on start, state, output, etc., info.
    // TODO: maybe we need to track last time the input was modified
    // or set a flag when input changes after last eval.  That's very
    // useful anyways (like in sagews)!
    return false;
  }*/

  private render_points(): Rendered {
    const points = this.props.nbgrader.get("points");
    if (points == null) return;
    return (
      <span style={{ marginLeft: "5px" }}>
        ({points} {plural(points, "point")})
      </span>
    );
  }

  private render_id(): Rendered {
    const id = this.props.nbgrader.get("grade_id");
    if (id == null) return;
    return <span>, ID: {id}</span>;
  }

  public render(): Rendered {
    const nbgrader = this.props.nbgrader.toJS();
    const value: string = state_to_value(nbgrader);
    const info = CELLTYPE_INFO_MAP[value];
    return (
      <Tip
        title={info.student_title}
        tip={info.student_tip}
        placement={"right"}
        size={"small"}
        style={{ cursor: "pointer" }}
      >
        <span>{info.student_title}</span>
        {this.render_points()}
        {this.render_id()}
      </Tip>
    );
  }
}<commit_msg>make student metadata title in jupyter less "link like"<commit_after>import { Map } from "immutable";

import { Component, React, Rendered } from "../../app-framework";

import { plural } from "smc-util/misc2";

import { CELLTYPE_INFO_MAP, state_to_value } from "./cell-types";

import { Tip } from "../../r_misc/tip";

interface Props {
  nbgrader: Map<string, any>;
  start?: number;
  state?: string;
  output?: Map<string, any>;
}

export class NBGraderMetadata extends Component<Props> {
  /*private is_correct(): boolean {
    // use heuristics to try to determine if they have successfully
    // validated their answer based on start, state, output, etc., info.
    // TODO: maybe we need to track last time the input was modified
    // or set a flag when input changes after last eval.  That's very
    // useful anyways (like in sagews)!
    return false;
  }*/

  private render_points(): Rendered {
    const points = this.props.nbgrader.get("points");
    if (points == null) return;
    return (
      <span style={{ marginLeft: "5px" }}>
        ({points} {plural(points, "point")})
      </span>
    );
  }

  private render_id(): Rendered {
    const id = this.props.nbgrader.get("grade_id");
    if (id == null) return;
    return <span>, ID: {id}</span>;
  }

  public render(): Rendered {
    const nbgrader = this.props.nbgrader.toJS();
    const value: string = state_to_value(nbgrader);
    const info = CELLTYPE_INFO_MAP[value];
    return (
      <Tip
        title={info.student_title}
        tip={info.student_tip}
        placement={"right"}
        size={"small"}
      >
        <span>{info.student_title}</span>
        {this.render_points()}
        {this.render_id()}
      </Tip>
    );
  }
}
{'fraction_non_alphanumeric': 0.14484356894553882, 'fraction_numerical': 0.0011587485515643105, 'mean_word_length': 2.823920265780731, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7243023', 'n_tokens_mistral': 1106, 'n_tokens_neox': 1089, 'n_words': 311}