Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCT Help #196

Open
ChanceHarmon opened this issue Dec 7, 2021 · 1 comment
Open

SCT Help #196

ChanceHarmon opened this issue Dec 7, 2021 · 1 comment

Comments

@ChanceHarmon
Copy link

ChanceHarmon commented Dec 7, 2021

I am sure this a total noob question. I am using React and the boilerplate code for a python example.

    <div data-datacamp-exercise data-lang="python">
    <code data-type="pre-exercise-code">
      # no pec
    </code>
    <code data-type="sample-code">
      # Create a variable a, equal to 5


      # Print out a

    </code>
    <code data-type="solution">
      # Create a variable a, equal to 5
      a = 5

      # Print out a
      print(a)
    </code>
    <code data-type="sct">
      test_object("a")
      test_function("print")
      success_msg("Great job!")
    </code>
    <div data-type="hint">
      Use the assignment operator (<code>=</code>) to create the variable <code>a</code>.
    </div>
    </div>

However, no matter what I put in the editor to submit, I get this error every time.

DataCamp encountered the following error:
Traceback (most recent call last):
File "/var/lib/python/site-packages/protobackend/output.py", line 70, in wrapper
output = f(*args, **kwargs)
File "/var/lib/python/site-packages/pythonbackend/commands.py", line 63, in worker_dispatch
return d.dispatch(cmd)
File "/var/lib/python/site-packages/protobackend/dispatcher.py", line 28, in dispatch
cmd_output = cmd(pre_payload)
File "/var/lib/python/site-packages/pythonbackend/Exercise.py", line 123, in runSubmit
self.dc_force_diagnose,
File "/var/lib/python/site-packages/pythonwhat/test_exercise.py", line 57, in test_exercise
exec(sct, sct_cntxt)
File "", line 1
test_object("a") test_function("print") success_msg("Great job!")
^
SyntaxError: invalid syntax

I get the same error on localhost and deployed site, so I don't believe it is related to those, unless there is some kind of permissions issue I haven't came across in researching.
I looked into pythonwhat and going down that path, but that seems like it shouldn't be needed to use the basic out of the box code base. Any help with this would be greatly appreciated.

@DrMondesire
Copy link

You are missing the javascript file declaration for datacamp light. Put this at the top of your code before:

<html>
<script src="https://cdn.datacamp.com/dcl-react.js.gz"></script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants