content conditional on if problem in quiz/test or homework

Abierto
#2,059 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 4 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
15/100
Tipo de issue
Nueva funcionalidad
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
perl
Área
backend

Línea de trabajo

The workaround lives in a macro file loaded through pgCourse.pl and reads $showHint, $numOfAttempts and $displayHintsQ, and the issue notes that $showHint is being removed in 2.18. Start by checking how the problem context (homework versus quiz, test or gateway) is exposed to PG macros in the current release. Done means the maintainers agree on a supported way to vary problem text by context, which the thread does not yet settle.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

This is a continuation of an idea posed in #1156, where @esternin discussed content being conditional on whether a problem is being presented in a regular homework set, or in a gateway/quiz/test.

I'm trying to have text conditionally appear for problems depending on the presentation context -- whether in a homework set or a quiz/test/gateway. here's my current solution, which relies on $showHint.

# I put this in a macro file, included via pgCourse.pl
sub theresahint {
 my $hintafter = $showHint+1;

my $hintReminder = '';
if ($numOfAttempts<$hintafter && $displayHintsQ == 1){
    $hintReminder = '(This problem has a hint that shows after ' . $hintafter . ' attempts.)';}

$hintReminder;
};

And then I include this in the problem text via

\{ theresahint \}

or if in PGML, I use

[@ theresahint @]*

is there a better way? so far I have failed to find, and now I learn that, per @drgrice1, $showHint is being removed in 2.18...

Lenguaje dominante
Perl
Estrellas
164
Forks
167
Merge medio
6 d 7 h
PR fusionados (30 d)
27

Preparar el entorno

  • Incluye un Dockerfile o un archivo de Docker Compose
  • Sin plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de openwebwork/webwork2

Todos los issues de openwebwork/webwork2

Issues similares

Más issues de Perl

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.